Struct rustc_query_impl::ty::subst::UserSelfTy[−][src]

pub struct UserSelfTy<'tcx> {
    pub impl_def_id: DefId,
    pub self_ty: &'tcx TyS<'tcx>,
}
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

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

This method turns the parameters of a DepNodeConstructor into an opaque Fingerprint to be used in DepNode. Not all DepNodeParams support being turned into a Fingerprint (they don’t need to if the corresponding DepNode is anonymous). Read more

This method tries to recover the query key from the given DepNode, something which is needed when forcing DepNodes during red-green evaluation. The query system will only call this method if fingerprint_style() is not FingerprintStyle::Opaque. It is always valid to return None here, in which case incremental compilation will treat the query as having changed instead of forcing it. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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