Expand description
Structs§
Enums§
Functions§
- bounds_
reference_ 🔒self - check_
receiver_ 🔒correct - This code checks that
receiver_is_dispatchable
is correctly implemented. - contains_
illegal_ 🔒impl_ trait_ in_ trait - contains_
illegal_ 🔒self_ type_ reference - This is somewhat subtle. In general, we want to forbid
references to
Self
in the argument and return types, since the value ofSelf
is erased. However, there is one exception: it is ok to referenceSelf
in order to access an associated type of the current trait, since we retain the value of those associated types in the object type itself. - dyn_
compatibility_ 🔒violations - dyn_
compatibility_ violations_ for_ assoc_ item - Returns
Some(_)
if this item makes the containing trait dyn-incompatible. - dyn_
compatibility_ 🔒violations_ for_ trait - generics_
require_ 🔒sized_ self - get_
sized_ 🔒bounds - hir_
ty_ lowering_ dyn_ compatibility_ violations - Returns the dyn-compatibility violations that affect HIR ty lowering.
- is_
dyn_ 🔒compatible - is_
vtable_ safe_ method - We say a method is vtable safe if it can be invoked on a trait
object. Note that object-safe traits can have some
non-vtable-safe methods, so long as they require
Self: Sized
or otherwise ensure that they cannot be used whenSelf = Trait
. - object_
ty_ 🔒for_ trait - Creates the object type for the current trait. For example,
if the current trait is
Deref
, then this will bedyn Deref<Target = Self::Target> + 'static
. - predicate_
references_ 🔒self - predicates_
reference_ 🔒self - provide 🔒
- receiver_
for_ 🔒self_ ty - Performs a type instantiation to produce the version of
receiver_ty
whenSelf = self_ty
. For example, forreceiver_ty = Rc<Self>
andself_ty = Foo
, returnsRc<Foo>
. - receiver_
is_ 🔒dispatchable - Checks the method’s receiver (the
self
argument) can be dispatched on whenSelf
is a trait object. We require thatDispatchableFromDyn
be implemented for the receiver type in the following way: - sized_
trait_ 🔒bound_ spans - super_
predicates_ 🔒have_ non_ lifetime_ binders - trait_
has_ 🔒sized_ self - virtual_
call_ 🔒violations_ for_ method - Returns
Some(_)
if this method cannot be called on a trait object; this does not necessarily imply that the enclosing trait is dyn-incompatible, because the method might have a where clauseSelf: Sized
.