pub enum Res<Id = !> {
Def(DefKind, DefId),
PrimTy(PrimTy),
SelfTyAlias {
alias_to: DefId,
is_trait_impl: bool,
},
SelfTyParam {
trait_: DefId,
},
Param(ParamKind, Id),
GlobalFunc(SpecFuncKind),
NumConst(i128),
Err,
}
Expand description
The resolution of a path
The enum contains a subset of the variants in [rustc_hir::def::Res
] plus some extra variants
for extra resolutions found in refinements.
Variants§
Def(DefKind, DefId)
See [rustc_hir::def::Res::Def
]
PrimTy(PrimTy)
See [rustc_hir::def::Res::PrimTy
]
SelfTyAlias
See [rustc_hir::def::Res::SelfTyAlias
]
SelfTyParam
See [rustc_hir::def::Res::SelfTyParam
]
Param(ParamKind, Id)
A refinement parameter, e.g., declared with @n
syntax
GlobalFunc(SpecFuncKind)
A refinement function defined with defs!
NumConst(i128)
A hack used to resolve u32::MAX
ans similar.
Err
Implementations§
Source§impl<Id> Res<Id>
impl<Id> Res<Id>
pub fn descr(&self) -> &'static str
pub fn is_box(&self, tcx: TyCtxt<'_>) -> bool
Sourcepub fn matches_ns(&self, ns: Namespace) -> bool
pub fn matches_ns(&self, ns: Namespace) -> bool
Always returns true
if self
is Res::Err
pub fn map_param_id<R>(self, f: impl FnOnce(Id) -> R) -> Res<R>
pub fn expect_param(self) -> (ParamKind, Id)
Trait Implementations§
impl<Id: Copy> Copy for Res<Id>
impl<Id: Eq> Eq for Res<Id>
impl<Id> StructuralPartialEq for Res<Id>
Auto Trait Implementations§
impl<Id> Freeze for Res<Id>where
Id: Freeze,
impl<Id> RefUnwindSafe for Res<Id>where
Id: RefUnwindSafe,
impl<Id> Send for Res<Id>where
Id: Send,
impl<Id> Sync for Res<Id>where
Id: Sync,
impl<Id> Unpin for Res<Id>where
Id: Unpin,
impl<Id> UnwindSafe for Res<Id>where
Id: UnwindSafe,
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<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<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