Struct rustc_typeck::middle::ty::TraitRefExperimental
[-]
[+]
[src]
pub struct TraitRef<'tcx> {
pub def_id: DefId,
pub substs: &'tcx Substs<'tcx>,
}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 def-id is the
def-id for the trait Foo and the substs defines T as parameter 0 in the
SelfSpace and U as parameter 0 in the TypeSpace.
Trait references also appear in object types like Foo<U>, but in
that case the Self parameter is absent from the substitutions.
Note that a TraitRef introduces a level of region binding, to
account for higher-ranked trait bounds like T : for<'a> Foo<&'a
U> or higher-ranked object types.
Fields
def_id | |
substs |