Enum rustc_resolve::late::RibKind[][src]

pub(crate) enum RibKind<'a> {
    ConstantItemRibKind(boolOption<(Ident, ConstantItemKind)>),
    ModuleRibKind(&'a ModuleData<'a>),
Expand description

The rib kind restricts certain accesses, e.g. to a Res::Local of an outer item.



No restriction needs to be applied.


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).


We passed through a closure. Disallow labels.


We passed through a function definition. Disallow upvars. Permit only those const parameters that are specified in the function’s generics.


We passed through an item scope. Disallow upvars.

Tuple Fields of ItemRibKind

0: HasGenericParams
ConstantItemRibKind(boolOption<(Ident, ConstantItemKind)>)

We’re in a constant item. Can’t refer to dynamic stuff.

The bool indicates if this constant may reference generic parameters and is used to only allow generic parameters to be used in trivial constant expressions.

Tuple Fields of ConstantItemRibKind

0: bool1: Option<(Ident, ConstantItemKind)>
ModuleRibKind(&'a ModuleData<'a>)

We passed through a module.

Tuple Fields of ModuleRibKind

0: &'a ModuleData<'a>

We passed through a macro_rules! statement

Tuple Fields of MacroDefinition

0: DefId

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.


We are inside of the type of a const parameter. Can’t refer to any parameters.


Whether this rib kind contains generic parameters, as opposed to local variables.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.


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: