Struct rustc_middle::ty::subst::UserSelfTy[][src]

pub struct UserSelfTy<'tcx> {
    pub impl_def_id: DefId,
    pub self_ty: Ty<'tcx>,

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


impl_def_id: DefIdself_ty: Ty<'tcx>

Trait Implementations

impl<'tcx> Clone for UserSelfTy<'tcx>[src]

impl<'tcx> Copy for UserSelfTy<'tcx>[src]

impl<'tcx> Debug for UserSelfTy<'tcx>[src]

impl<'tcx, __D: TyDecoder<'tcx>> Decodable<__D> for UserSelfTy<'tcx>[src]

impl<'tcx, __E: TyEncoder<'tcx>> Encodable<__E> for UserSelfTy<'tcx>[src]

impl<'tcx> Eq for UserSelfTy<'tcx>[src]

impl<'tcx> Hash for UserSelfTy<'tcx>[src]

impl<'tcx, '__ctx> HashStable<StableHashingContext<'__ctx>> for UserSelfTy<'tcx>[src]

impl<'tcx, '__lifted> Lift<'__lifted> for UserSelfTy<'tcx>[src]

type Lifted = UserSelfTy<'__lifted>

impl<'tcx> PartialEq<UserSelfTy<'tcx>> for UserSelfTy<'tcx>[src]

impl<'tcx> StructuralEq for UserSelfTy<'tcx>[src]

impl<'tcx> StructuralPartialEq for UserSelfTy<'tcx>[src]

impl<'tcx> TypeFoldable<'tcx> for UserSelfTy<'tcx>[src]

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

impl<T> Any for T where
    T: 'static + ?Sized

impl<'tcx, T> ArenaAllocatable<'tcx, ()> for T where
    T: Copy

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<'a, T> Captures<'a> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> MaybeResult<T> for T[src]

type Error = !

impl<'tcx, T> Subst<'tcx> for T where
    T: TypeFoldable<'tcx>, 

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> WithConstness for T[src]