pub enum PathElem {
Ident(String, Disambiguator),
Impl(ImplElem),
Instantiated(Box<Binder<GenericArgs>>),
Target(TargetTriple),
Builtin(BuiltinPathElem, Disambiguator),
}Expand description
See the comments for Name
Variants§
Ident(String, Disambiguator)
Impl(ImplElem)
Instantiated(Box<Binder<GenericArgs>>)
This item was obtained by instantiating its parent with the given args. The binder binds the parameters of the new items. If the binder binds nothing then this is a monomorphization.
Target(TargetTriple)
This item is only available on the given target. Only appears in multi-target mode.
Builtin(BuiltinPathElem, Disambiguator)
A path element that doesn’t come from the source code: either a builtin type such as tuples, or an item that has no name of its own such as a closure or a vtable.
Implementations§
Source§impl PathElem
impl PathElem
Sourcepub fn as_ident_mut(&mut self) -> Option<(&mut String, &mut Disambiguator)>
pub fn as_ident_mut(&mut self) -> Option<(&mut String, &mut Disambiguator)>
Optionally returns mutable references to the inner fields if this is a PathElem::Ident, otherwise None
Sourcepub fn as_ident(&self) -> Option<(&String, &Disambiguator)>
pub fn as_ident(&self) -> Option<(&String, &Disambiguator)>
Optionally returns references to the inner fields if this is a PathElem::Ident, otherwise None
Sourcepub fn into_ident(self) -> Result<(String, Disambiguator), Self>
pub fn into_ident(self) -> Result<(String, Disambiguator), Self>
Returns the inner fields if this is a PathElem::Ident, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_ident_unchecked(self) -> (String, Disambiguator)
pub unsafe fn into_ident_unchecked(self) -> (String, Disambiguator)
Unchecked return of the inner fields of PathElem::Ident.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_ident_unchecked(&self) -> (&String, &Disambiguator)
pub unsafe fn as_ident_unchecked(&self) -> (&String, &Disambiguator)
Unchecked reference of the inner fields of PathElem::Ident.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_ident_mut_unchecked(
&mut self,
) -> (&mut String, &mut Disambiguator)
pub unsafe fn as_ident_mut_unchecked( &mut self, ) -> (&mut String, &mut Disambiguator)
Unchecked mutable reference of the inner fields of PathElem::Ident.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn as_impl_mut(&mut self) -> Option<&mut ImplElem>
pub fn as_impl_mut(&mut self) -> Option<&mut ImplElem>
Optionally returns mutable references to the inner fields if this is a PathElem::Impl, otherwise None
Sourcepub fn as_impl(&self) -> Option<&ImplElem>
pub fn as_impl(&self) -> Option<&ImplElem>
Optionally returns references to the inner fields if this is a PathElem::Impl, otherwise None
Sourcepub fn into_impl(self) -> Result<ImplElem, Self>
pub fn into_impl(self) -> Result<ImplElem, Self>
Returns the inner fields if this is a PathElem::Impl, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_impl_unchecked(self) -> ImplElem
pub unsafe fn into_impl_unchecked(self) -> ImplElem
Unchecked return of the inner fields of PathElem::Impl.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_impl_unchecked(&self) -> &ImplElem
pub unsafe fn as_impl_unchecked(&self) -> &ImplElem
Unchecked reference of the inner fields of PathElem::Impl.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_impl_mut_unchecked(&mut self) -> &mut ImplElem
pub unsafe fn as_impl_mut_unchecked(&mut self) -> &mut ImplElem
Unchecked mutable reference of the inner fields of PathElem::Impl.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn is_instantiated(&self) -> bool
pub fn is_instantiated(&self) -> bool
Returns true if this is a PathElem::Instantiated, otherwise false
Sourcepub fn as_instantiated_mut(&mut self) -> Option<&mut Box<Binder<GenericArgs>>>
pub fn as_instantiated_mut(&mut self) -> Option<&mut Box<Binder<GenericArgs>>>
Optionally returns mutable references to the inner fields if this is a PathElem::Instantiated, otherwise None
Sourcepub fn as_instantiated(&self) -> Option<&Box<Binder<GenericArgs>>>
pub fn as_instantiated(&self) -> Option<&Box<Binder<GenericArgs>>>
Optionally returns references to the inner fields if this is a PathElem::Instantiated, otherwise None
Sourcepub fn into_instantiated(self) -> Result<Box<Binder<GenericArgs>>, Self>
pub fn into_instantiated(self) -> Result<Box<Binder<GenericArgs>>, Self>
Returns the inner fields if this is a PathElem::Instantiated, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_instantiated_unchecked(self) -> Box<Binder<GenericArgs>>
pub unsafe fn into_instantiated_unchecked(self) -> Box<Binder<GenericArgs>>
Unchecked return of the inner fields of PathElem::Instantiated.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_instantiated_unchecked(&self) -> &Box<Binder<GenericArgs>>
pub unsafe fn as_instantiated_unchecked(&self) -> &Box<Binder<GenericArgs>>
Unchecked reference of the inner fields of PathElem::Instantiated.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_instantiated_mut_unchecked(
&mut self,
) -> &mut Box<Binder<GenericArgs>>
pub unsafe fn as_instantiated_mut_unchecked( &mut self, ) -> &mut Box<Binder<GenericArgs>>
Unchecked mutable reference of the inner fields of PathElem::Instantiated.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn as_target_mut(&mut self) -> Option<&mut TargetTriple>
pub fn as_target_mut(&mut self) -> Option<&mut TargetTriple>
Optionally returns mutable references to the inner fields if this is a PathElem::Target, otherwise None
Sourcepub fn as_target(&self) -> Option<&TargetTriple>
pub fn as_target(&self) -> Option<&TargetTriple>
Optionally returns references to the inner fields if this is a PathElem::Target, otherwise None
Sourcepub fn into_target(self) -> Result<TargetTriple, Self>
pub fn into_target(self) -> Result<TargetTriple, Self>
Returns the inner fields if this is a PathElem::Target, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_target_unchecked(self) -> TargetTriple
pub unsafe fn into_target_unchecked(self) -> TargetTriple
Unchecked return of the inner fields of PathElem::Target.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_target_unchecked(&self) -> &TargetTriple
pub unsafe fn as_target_unchecked(&self) -> &TargetTriple
Unchecked reference of the inner fields of PathElem::Target.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_target_mut_unchecked(&mut self) -> &mut TargetTriple
pub unsafe fn as_target_mut_unchecked(&mut self) -> &mut TargetTriple
Unchecked mutable reference of the inner fields of PathElem::Target.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn is_builtin(&self) -> bool
pub fn is_builtin(&self) -> bool
Returns true if this is a PathElem::Builtin, otherwise false
Sourcepub fn as_builtin_mut(
&mut self,
) -> Option<(&mut BuiltinPathElem, &mut Disambiguator)>
pub fn as_builtin_mut( &mut self, ) -> Option<(&mut BuiltinPathElem, &mut Disambiguator)>
Optionally returns mutable references to the inner fields if this is a PathElem::Builtin, otherwise None
Sourcepub fn as_builtin(&self) -> Option<(&BuiltinPathElem, &Disambiguator)>
pub fn as_builtin(&self) -> Option<(&BuiltinPathElem, &Disambiguator)>
Optionally returns references to the inner fields if this is a PathElem::Builtin, otherwise None
Sourcepub fn into_builtin(self) -> Result<(BuiltinPathElem, Disambiguator), Self>
pub fn into_builtin(self) -> Result<(BuiltinPathElem, Disambiguator), Self>
Returns the inner fields if this is a PathElem::Builtin, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_builtin_unchecked(self) -> (BuiltinPathElem, Disambiguator)
pub unsafe fn into_builtin_unchecked(self) -> (BuiltinPathElem, Disambiguator)
Unchecked return of the inner fields of PathElem::Builtin.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_builtin_unchecked(&self) -> (&BuiltinPathElem, &Disambiguator)
pub unsafe fn as_builtin_unchecked(&self) -> (&BuiltinPathElem, &Disambiguator)
Unchecked reference of the inner fields of PathElem::Builtin.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_builtin_mut_unchecked(
&mut self,
) -> (&mut BuiltinPathElem, &mut Disambiguator)
pub unsafe fn as_builtin_mut_unchecked( &mut self, ) -> (&mut BuiltinPathElem, &mut Disambiguator)
Unchecked mutable reference of the inner fields of PathElem::Builtin.
§Safety
Results in undefined behavior when it is the incorrect variant.
Source§impl PathElem
impl PathElem
fn equals_ident(&self, id: &str) -> bool
pub fn as_monomorphized(&self) -> Option<&GenericArgs>
pub fn as_monomorphized_mut(&mut self) -> Option<&mut GenericArgs>
pub fn is_monomorphized(&self) -> bool
Trait Implementations§
Source§impl AstVisitable for PathElem
impl AstVisitable for PathElem
Source§fn drive<V: VisitAst>(&self, v: &mut V) -> ControlFlow<V::Break>
fn drive<V: VisitAst>(&self, v: &mut V) -> ControlFlow<V::Break>
visit_$any
method if it exists, otherwise visit_inner.Source§fn drive_mut<V: VisitAstMut>(&mut self, v: &mut V) -> ControlFlow<V::Break>
fn drive_mut<V: VisitAstMut>(&mut self, v: &mut V) -> ControlFlow<V::Break>
visit_$any
method if it exists, otherwise visit_inner.Source§fn drive_two<V: ZipAst>(&self, other: &Self, v: &mut V) -> ControlFlow<V::Break>
fn drive_two<V: ZipAst>(&self, other: &Self, v: &mut V) -> ControlFlow<V::Break>
visit_$any
method if it exists, otherwise visit_inner.Source§fn dyn_visit<T: AstVisitable>(&self, f: impl FnMut(&T))where
Self: Sized,
fn dyn_visit<T: AstVisitable>(&self, f: impl FnMut(&T))where
Self: Sized,
self, in pre-order traversal.Source§fn dyn_visit_mut<T: AstVisitable>(&mut self, f: impl FnMut(&mut T))where
Self: Sized,
fn dyn_visit_mut<T: AstVisitable>(&mut self, f: impl FnMut(&mut T))where
Self: Sized,
self, in pre-order traversal.Source§impl<'de, __State: ?Sized> DeserializeState<'de, __State> for PathElemwhere
String: Deserialize<'de>,
Disambiguator: Deserialize<'de>,
ImplElem: DeserializeState<'de, __State>,
Box<Binder<GenericArgs>>: DeserializeState<'de, __State>,
TargetTriple: Deserialize<'de>,
BuiltinPathElem: Deserialize<'de>,
impl<'de, __State: ?Sized> DeserializeState<'de, __State> for PathElemwhere
String: Deserialize<'de>,
Disambiguator: Deserialize<'de>,
ImplElem: DeserializeState<'de, __State>,
Box<Binder<GenericArgs>>: DeserializeState<'de, __State>,
TargetTriple: Deserialize<'de>,
BuiltinPathElem: Deserialize<'de>,
fn deserialize_state<__D>(
__state: &__State,
__deserializer: __D,
) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<'s, V> Drive<'s, V> for PathElemwhere
V: Visitor + Visit<'s, String> + Visit<'s, Disambiguator> + Visit<'s, ImplElem> + Visit<'s, Box<Binder<GenericArgs>>> + Visit<'s, TargetTriple> + Visit<'s, BuiltinPathElem>,
impl<'s, V> Drive<'s, V> for PathElemwhere
V: Visitor + Visit<'s, String> + Visit<'s, Disambiguator> + Visit<'s, ImplElem> + Visit<'s, Box<Binder<GenericArgs>>> + Visit<'s, TargetTriple> + Visit<'s, BuiltinPathElem>,
Source§fn drive_inner(&'s self, visitor: &mut V) -> ControlFlow<V::Break>
fn drive_inner(&'s self, visitor: &mut V) -> ControlFlow<V::Break>
v.visit() on the immediate contents of self.Source§impl<'s, V> DriveMut<'s, V> for PathElemwhere
V: Visitor + VisitMut<'s, String> + VisitMut<'s, Disambiguator> + VisitMut<'s, ImplElem> + VisitMut<'s, Box<Binder<GenericArgs>>> + VisitMut<'s, TargetTriple> + VisitMut<'s, BuiltinPathElem>,
impl<'s, V> DriveMut<'s, V> for PathElemwhere
V: Visitor + VisitMut<'s, String> + VisitMut<'s, Disambiguator> + VisitMut<'s, ImplElem> + VisitMut<'s, Box<Binder<GenericArgs>>> + VisitMut<'s, TargetTriple> + VisitMut<'s, BuiltinPathElem>,
Source§fn drive_inner_mut(&'s mut self, visitor: &mut V) -> ControlFlow<V::Break>
fn drive_inner_mut(&'s mut self, visitor: &mut V) -> ControlFlow<V::Break>
v.visit() on the immediate contents of self.Source§impl<'s, V> DriveTwo<'s, V> for PathElemwhere
V: Visitor<Break: Default> + VisitTwo<'s, String> + VisitTwo<'s, Disambiguator> + VisitTwo<'s, ImplElem> + VisitTwo<'s, Box<Binder<GenericArgs>>> + VisitTwo<'s, TargetTriple> + VisitTwo<'s, BuiltinPathElem>,
impl<'s, V> DriveTwo<'s, V> for PathElemwhere
V: Visitor<Break: Default> + VisitTwo<'s, String> + VisitTwo<'s, Disambiguator> + VisitTwo<'s, ImplElem> + VisitTwo<'s, Box<Binder<GenericArgs>>> + VisitTwo<'s, TargetTriple> + VisitTwo<'s, BuiltinPathElem>,
Source§fn drive_two_inner(
&'s self,
other: &'s Self,
visitor: &mut V,
) -> ControlFlow<V::Break>
fn drive_two_inner( &'s self, other: &'s Self, visitor: &mut V, ) -> ControlFlow<V::Break>
v.visit() on the immediate contents of self and other, if they correspond. If
the values don’t match up, this returns Break(Default::default()).impl Eq for PathElem
Source§impl<C: AstFormatter> FmtWithCtx<C> for PathElem
impl<C: AstFormatter> FmtWithCtx<C> for PathElem
Source§impl<__State: ?Sized> SerializeState<__State> for PathElemwhere
String: Serialize,
Disambiguator: Serialize,
ImplElem: SerializeState<__State>,
Box<Binder<GenericArgs>>: SerializeState<__State>,
TargetTriple: Serialize,
BuiltinPathElem: Serialize,
impl<__State: ?Sized> SerializeState<__State> for PathElemwhere
String: Serialize,
Disambiguator: Serialize,
ImplElem: SerializeState<__State>,
Box<Binder<GenericArgs>>: SerializeState<__State>,
TargetTriple: Serialize,
BuiltinPathElem: Serialize,
fn serialize_state<__S>(
&self,
__state: &__State,
__serializer: __S,
) -> Result<__S::Ok, __S::Error>where
__S: Serializer,
impl StructuralPartialEq for PathElem
Auto Trait Implementations§
impl Freeze for PathElem
impl RefUnwindSafe for PathElem
impl Send for PathElem
impl Sync for PathElem
impl Unpin for PathElem
impl UnsafeUnpin for PathElem
impl UnwindSafe for PathElem
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 moreimpl<T> Mappable for T
Source§impl<T> TyVisitable for Twhere
T: AstVisitable,
impl<T> TyVisitable for Twhere
T: AstVisitable,
Source§fn type_info(&self) -> TypeInfo
fn type_info(&self) -> TypeInfo
TypeInfo.Source§fn visit_vars(&mut self, v: &mut impl VarsVisitor)
fn visit_vars(&mut self, v: &mut impl VarsVisitor)
self, as seen from the outside of self. This means
that any variable bound inside self will be skipped, and all the seen De Bruijn indices
will count from the outside of self.Source§fn substitute(self, generics: &GenericArgs) -> Self
fn substitute(self, generics: &GenericArgs) -> Self
self by replacing them with the provided values.
Note: if self is an item that comes from a TraitDecl, you must use
substitute_with_self or substitute_inner_binder, otherwise you’ll get panics.Source§fn substitute_inner_binder(self, generics: &GenericArgs) -> Self
fn substitute_inner_binder(self, generics: &GenericArgs) -> Self
self by replacing them with the provided values.
This is appropriate when substituting an inner binder.Source§fn substitute_explicits(self, generics: &GenericArgs) -> Self
fn substitute_explicits(self, generics: &GenericArgs) -> Self
Source§fn substitute_with_self(
self,
generics: &GenericArgs,
self_ref: &TraitRefKind,
) -> Self
fn substitute_with_self( self, generics: &GenericArgs, self_ref: &TraitRefKind, ) -> Self
TraitRefKind::SelfId trait ref.Source§fn substitute_with_tref(self, tref: &TraitRef) -> Self
fn substitute_with_tref(self, tref: &TraitRef) -> Self
TraitRefKind::SelfId trait ref.Source§fn try_substitute_with_tref(
self,
tref: &TraitRef,
) -> Result<Self, GenericsMismatch>
fn try_substitute_with_tref( self, tref: &TraitRef, ) -> Result<Self, GenericsMismatch>
TraitRefKind::SelfId trait ref.fn try_substitute( self, generics: &GenericArgs, ) -> Result<Self, GenericsMismatch>
fn try_substitute_with_self( self, generics: &GenericArgs, self_ref: &TraitRefKind, ) -> Result<Self, GenericsMismatch>
Source§fn move_under_binder(self) -> Self
fn move_under_binder(self) -> Self
Source§fn move_under_binders(self, depth: DeBruijnId) -> Self
fn move_under_binders(self, depth: DeBruijnId) -> Self
depth binders.Source§fn move_from_under_binder(self) -> Option<Self>
fn move_from_under_binder(self) -> Option<Self>
Source§fn move_from_under_binders(self, depth: DeBruijnId) -> Option<Self>
fn move_from_under_binders(self, depth: DeBruijnId) -> Option<Self>
depth binders. Returns None if it contains a variable bound in
one of these depth binders.Source§fn visit_db_id<B>(
&mut self,
f: impl FnMut(&mut DeBruijnId) -> ControlFlow<B>,
) -> ControlFlow<B>
fn visit_db_id<B>( &mut self, f: impl FnMut(&mut DeBruijnId) -> ControlFlow<B>, ) -> ControlFlow<B>
self, as seen from the outside of self. This means
that any variable bound inside self will be skipped, and all the seen indices will count
from the outside of self.Source§fn has_escaping_region_var(&self) -> bool
fn has_escaping_region_var(&self) -> bool
Source§fn collect_regions(&self) -> SeqHashSet<Region>
fn collect_regions(&self) -> SeqHashSet<Region>
self.