Struct rustc_trans::middle::ty::TraitDef
[−]
[src]
pub struct TraitDef<'tcx> {
pub unsafety: Unsafety,
pub paren_sugar: bool,
pub generics: Generics<'tcx>,
pub trait_ref: TraitRef<'tcx>,
pub associated_type_names: Vec<Name>,
pub nonblanket_impls: RefCell<HashMap<SimplifiedType, Vec<DefId>, DefaultState<FnvHasher>>>,
pub blanket_impls: RefCell<Vec<DefId>>,
pub flags: Cell<TraitFlags>,
}As TypeScheme but for a trait ref.
Fields
unsafety | Unstable |
paren_sugar | Unstable If |
generics | Unstable Generic type definitions. Note that |
trait_ref | Unstable |
associated_type_names | Unstable A list of the associated types defined in this trait. Useful
for resolving |
nonblanket_impls | Unstable Impls of the trait. |
blanket_impls | Unstable Blanket impls associated with the trait. |
flags | Unstable Various flags |
Methods
impl<'tcx> TraitDef<'tcx>
fn object_safety(&self) -> Option<bool>
fn set_object_safety(&self, is_safe: bool)
fn record_impl(&self, tcx: &ctxt<'tcx>, impl_def_id: DefId, impl_trait_ref: TraitRef<'tcx>)
Records a trait-to-implementation mapping.