Struct rustc_monomorphize::ty::TraitRef [−][src]
pub struct TraitRef<'tcx> {
pub def_id: DefId,
pub substs: &'tcx List<GenericArg<'tcx>>,
}Expand description
A complete reference to a trait. These take numerous guises in syntax, but perhaps the most recognizable form is in a where-clause:
T: Foo<U>This would be represented by a trait-reference where the DefId is the
DefId for the trait Foo and the substs define T as parameter 0,
and U as parameter 1.
Trait references also appear in object types like Foo<U>, but in
that case the Self parameter is absent from the substitutions.
Fields
def_id: DefIdsubsts: &'tcx List<GenericArg<'tcx>>Auto Trait Implementations
impl<'tcx> !RefUnwindSafe for TraitRef<'tcx>
impl<'tcx> !UnwindSafe for TraitRef<'tcx>
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn subst_spanned(
self,
tcx: TyCtxt<'tcx>,
substs: &[GenericArg<'tcx>],
span: Option<Span>
) -> T
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 16 bytes