Struct clippy_utils::rustc_ty::subst::UserSelfTy [−][src]
Expand description
Specifies the user-given self type. In the case of a path that refers to a member in an inherent impl, this self type is sometimes needed to constrain the type parameters on the impl. For example, in this code:
struct Foo<T> { }
impl<A> Foo<A> { fn method() { } }when you then have a path like <Foo<&'static u32>>::method,
this struct would carry the DefId of the impl along with the
self type Foo<u32>. Then we can instantiate the parameters of
the impl (with the substs from UserSubsts) and apply those to
the self type, giving Foo<?A>. Finally, we unify that with
the self type here, which contains ?A to be &'static u32
Fields
impl_def_id: DefIdself_ty: &'tcx TyS<'tcx>Auto Trait Implementations
impl<'tcx> !RefUnwindSafe for UserSelfTy<'tcx>
impl<'tcx> !Send for UserSelfTy<'tcx>
impl<'tcx> !Sync for UserSelfTy<'tcx>
impl<'tcx> Unpin for UserSelfTy<'tcx>
impl<'tcx> !UnwindSafe for UserSelfTy<'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