[−][src]Module rustc::traits::object_safety
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
"Object safety" refers to the ability for a trait to be converted to an object. In general, traits may only be converted to an object if all of their methods meet certain criteria. In particular, they must:
- have a suitable receiver from which we can extract a vtable;
- not reference the erased type
Self
except for in this receiver; - not have generic type parameters
Enums
MethodViolationCode |
[ Experimental ] Reasons a method might not be object-safe. |
ObjectSafetyViolation |
[ Experimental ]
|
Functions
is_object_safe_provider |
[ Experimental ]
|