pub enum RustcItem<'tcx> {
Poly(DefId),
Mono(ItemRef<'tcx>),
MonoTrait(DefId),
}Expand description
Refers to a rustc item. Can be either the polymorphic version (Poly) of the item, or a
monomorphization (Mono or MonoTrait) of it.
For MonoTrait items, their kind should be either trait decl or struct vtable:
1. the trait is translated as in poly mode, except that we don’t translate any of its
associated item lists.
2. the vtable is translated with erased signature of the methods and without generic types.
In other words, there is one “opaque” vtable per trait.
Variants§
Implementations§
Source§impl<'tcx> RustcItem<'tcx>
impl<'tcx> RustcItem<'tcx>
pub fn def_id(&self) -> &DefId
Sourcepub fn with_def_id(&self, s: &impl BaseState<'tcx>, def_id: &DefId) -> Self
pub fn with_def_id(&self, s: &impl BaseState<'tcx>, def_id: &DefId) -> Self
Set the DefId, keeping the same generic arguments and resolutions.
Sourcepub fn peel_derived(&self, s: &impl BaseState<'tcx>) -> Self
pub fn peel_derived(&self, s: &impl BaseState<'tcx>) -> Self
Remove one derived-item layer.
Sourcepub fn derived_base(&self, s: &impl BaseState<'tcx>) -> Self
pub fn derived_base(&self, s: &impl BaseState<'tcx>) -> Self
Refer to the (recursive) base item.
Sourcepub fn make_derived(
&self,
s: &impl BaseState<'tcx>,
kind: DerivedItemKind,
) -> Self
pub fn make_derived( &self, s: &impl BaseState<'tcx>, kind: DerivedItemKind, ) -> Self
Refer to the derived item.
Trait Implementations§
impl<'tcx> Eq for RustcItem<'tcx>
impl<'tcx> StructuralPartialEq for RustcItem<'tcx>
Auto Trait Implementations§
impl<'tcx> DynSend for RustcItem<'tcx>
impl<'tcx> DynSync for RustcItem<'tcx>
impl<'tcx> Forget for RustcItem<'tcx>
impl<'tcx> Freeze for RustcItem<'tcx>
impl<'tcx> Move for RustcItem<'tcx>
impl<'tcx> RefUnwindSafe for RustcItem<'tcx>
impl<'tcx> Send for RustcItem<'tcx>
impl<'tcx> Sync for RustcItem<'tcx>
impl<'tcx> Unpin for RustcItem<'tcx>
impl<'tcx> UnsafeUnpin for RustcItem<'tcx>
impl<'tcx> UnwindSafe for RustcItem<'tcx>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Dedup for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<T> HashConsable for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more