pub(crate) enum RibKind<'ra> {
Normal,
AssocItem,
FnOrCoroutine,
Item(HasGenericParams, DefKind),
ConstantItem(ConstantHasGenerics, Option<(Ident, ConstantItemKind)>),
Module(Module<'ra>),
MacroDefinition(DefId),
ForwardGenericParamBan,
ConstParamTy,
InlineAsmSym,
}
Expand description
The rib kind restricts certain accesses,
e.g. to a Res::Local
of an outer item.
Variants§
Normal
No restriction needs to be applied.
AssocItem
We passed through an impl or trait and are now in one of its methods or associated types. Allow references to ty params that impl or trait binds. Disallow any other upvars (including other ty params that are upvars).
FnOrCoroutine
We passed through a function, closure or coroutine signature. Disallow labels.
Item(HasGenericParams, DefKind)
We passed through an item scope. Disallow upvars.
ConstantItem(ConstantHasGenerics, Option<(Ident, ConstantItemKind)>)
We’re in a constant item. Can’t refer to dynamic stuff.
The item may reference generic parameters in trivial constant expressions. All other constants aren’t allowed to use generic params at all.
Module(Module<'ra>)
We passed through a module.
MacroDefinition(DefId)
We passed through a macro_rules!
statement
ForwardGenericParamBan
All bindings in this rib are generic parameters that can’t be used
from the default of a generic parameter because they’re not declared
before said generic parameter. Also see the visit_generics
override.
ConstParamTy
We are inside of the type of a const parameter. Can’t refer to any parameters.
InlineAsmSym
We are inside a sym
inline assembly operand. Can only refer to
globals.
Implementations§
Source§impl RibKind<'_>
impl RibKind<'_>
Sourcepub(crate) fn contains_params(&self) -> bool
pub(crate) fn contains_params(&self) -> bool
Whether this rib kind contains generic parameters, as opposed to local variables.
Sourcefn is_label_barrier(self) -> bool
fn is_label_barrier(self) -> bool
This rib forbids referring to labels defined in upwards ribs.
Trait Implementations§
impl<'ra> Copy for RibKind<'ra>
Auto Trait Implementations§
impl<'ra> !DynSend for RibKind<'ra>
impl<'ra> !DynSync for RibKind<'ra>
impl<'ra> Freeze for RibKind<'ra>
impl<'ra> !RefUnwindSafe for RibKind<'ra>
impl<'ra> !Send for RibKind<'ra>
impl<'ra> !Sync for RibKind<'ra>
impl<'ra> Unpin for RibKind<'ra>
impl<'ra> !UnwindSafe for RibKind<'ra>
Blanket Implementations§
Source§impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut T
fn allocate_from_iter( arena: &'tcx Arena<'tcx>, iter: impl IntoIterator<Item = T>, ) -> &'tcx mut [T]
Source§impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut T
fn allocate_from_iter( arena: &'tcx Arena<'tcx>, iter: impl IntoIterator<Item = T>, ) -> &'tcx mut [T]
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,
Source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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 moreSource§impl<P> IntoQueryParam<P> for P
impl<P> IntoQueryParam<P> for P
fn into_query_param(self) -> P
Source§impl<T> MaybeResult<T> for T
impl<T> MaybeResult<T> for T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
Source§impl<I, T> UpcastFrom<I, T> for T
impl<I, T> UpcastFrom<I, T> for T
fn upcast_from(from: T, _tcx: I) -> T
Source§impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
default fn from_cycle_error( tcx: Tcx, cycle_error: &CycleError, _guar: ErrorGuaranteed, ) -> T
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
impl<T> ErasedDestructor for Twhere
T: 'static,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 24 bytes
Size for each variant:
Normal
: 0 bytesAssocItem
: 0 bytesFnOrCoroutine
: 0 bytesItem
: 15 bytesConstantItem
: 19 bytesModule
: 15 bytesMacroDefinition
: 11 bytesForwardGenericParamBan
: 0 bytesConstParamTy
: 0 bytesInlineAsmSym
: 0 bytes