pub struct TraitDef<'tcx> {
pub unsafety: Unsafety,
pub paren_sugar: bool,
pub generics: Generics<'tcx>,
pub trait_ref: Rc<TraitRef<'tcx>>,
pub associated_type_names: Vec<Name>,
}
As TypeScheme
but for a trait ref.
Fields
unsafety | |
paren_sugar | If true , then this trait had the #[rustc_paren_sugar]
attribute, indicating that it should be used with Foo()
sugar. This is a temporary thing -- eventually any trait wil
be usable with the sugar (or without it).
|
generics | Generic type definitions. Note that Self is listed in here
as having a single bound, the trait itself (e.g., in the trait
Eq , there is a single bound Self : Eq ). This is so that
default methods get to assume that the Self parameters
implements the trait.
|
trait_ref | |
associated_type_names | A list of the associated types defined in this trait. Useful
for resolving X::Foo type markers.
|
Trait Implementations
impl<'tcx> Repr<'tcx> for TraitDef<'tcx>