pub enum SyntheticItem {
Array,
Slice,
Tuple(usize),
Str,
FnPtr(FnPtrShape),
}Expand description
We create some extra DefIds to represent things that rustc doesn’t have a DefId for. This
makes the pipeline much easier to have “real” def_ids for them, as we can then solve traits
for them etc, and works well with monomorphization.
Variants§
Array
Fake ADT representing the [T; N] type.
Slice
Fake ADT representing the [T] type.
Tuple(usize)
Fake ADT representing the length-n tuple (A, B, ...).
Str
Fake ADT representing str, which wraps a [u8].
FnPtr(FnPtrShape)
Fake item representing a particular shape of function pointer types.
E.g. for<'a> fn(&'a u32) -> Adt<'a, u32> is considered to be an instantiation of the fake
item for<'a> fn(&'a A) -> Adt<'a, B> with A=B=u32. Note how the item can therefore
have trait clauses if some Adt does.
Every free region, type and constant in the shape is a distinct generic parameter.
Implementations§
Source§impl SyntheticItem
impl SyntheticItem
pub fn name(&self) -> String
pub fn can_have_generics<'tcx>(&self, s: &impl BaseState<'tcx>) -> bool
pub fn generics_of<'tcx>(&self, s: &impl BaseState<'tcx>) -> &'tcx Generics
pub fn identity_args<'tcx>( &self, s: &impl BaseState<'tcx>, ) -> GenericArgsRef<'tcx>
pub fn param_env<'tcx>(&self, s: &impl BaseState<'tcx>) -> ParamEnv<'tcx>
pub fn late_bound_scope<'tcx>(&self, s: &impl BaseState<'tcx>) -> RDefId
Sourcepub fn const_param_ty<'tcx>(
self,
s: &impl BaseState<'tcx>,
index: u32,
) -> Option<Ty<'tcx>>
pub fn const_param_ty<'tcx>( self, s: &impl BaseState<'tcx>, index: u32, ) -> Option<Ty<'tcx>>
Return the type of this constant parameter. tcx.type_of can’t work here because we’re
reusing a dummy DefId for the generic parameter.
pub fn predicates_defined_on<'tcx>( &self, s: &impl BaseState<'tcx>, def_id: DefId, direction: PredicateDirection, ) -> ItemPredicates<'tcx, DefId>
pub fn type_of<'tcx>( &self, s: &impl BaseState<'tcx>, ) -> EarlyBinder<'tcx, Ty<'tcx>>
fn data<'tcx>(&self, s: &impl BaseState<'tcx>) -> SyntheticItemData<'tcx>
Trait Implementations§
Source§impl Clone for SyntheticItem
impl Clone for SyntheticItem
Source§fn clone(&self) -> SyntheticItem
fn clone(&self) -> SyntheticItem
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SyntheticItem
Source§impl Debug for SyntheticItem
impl Debug for SyntheticItem
impl Eq for SyntheticItem
Source§impl Hash for SyntheticItem
impl Hash for SyntheticItem
Source§impl PartialEq for SyntheticItem
impl PartialEq for SyntheticItem
impl StructuralPartialEq for SyntheticItem
Auto Trait Implementations§
impl DynSend for SyntheticItem
impl DynSync for SyntheticItem
impl Freeze for SyntheticItem
impl RefUnwindSafe for SyntheticItem
impl Send for SyntheticItem
impl Sync for SyntheticItem
impl Unpin for SyntheticItem
impl UnsafeUnpin for SyntheticItem
impl UnwindSafe for SyntheticItem
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
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
§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
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> ⓘ
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> ⓘ
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> ⓘ
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