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

pub(crate) enum RibKind<'a> {
    NormalRibKind,
    AssocItemRibKind,
    ClosureOrAsyncRibKind,
    FnItemRibKind,
    ItemRibKind(HasGenericParams),
    ConstantItemRibKind(bool, Option<(Ident, ConstantItemKind)>),
    ModuleRibKind(&'a ModuleData<'a>),
    MacroDefinition(DefId),
    ForwardGenericParamBanRibKind,
    ConstParamTyRibKind,
}
Expand description

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

Variants

NormalRibKind
Expand description

No restriction needs to be applied.

AssocItemRibKind
Expand description

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

ClosureOrAsyncRibKind
Expand description

We passed through a closure. Disallow labels.

FnItemRibKind
Expand description

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

ItemRibKind(HasGenericParams)
Expand description

We passed through an item scope. Disallow upvars.

ConstantItemRibKind(bool, Option<(Ident, ConstantItemKind)>)
Expand description

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.

ModuleRibKind(&'a ModuleData<'a>)
Expand description

We passed through a module.

MacroDefinition(DefId)
Expand description

We passed through a macro_rules! statement

ForwardGenericParamBanRibKind
Expand description

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.

ConstParamTyRibKind
Expand description

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

Implementations

impl RibKind<'_>[src]

pub(crate) fn contains_params(&self) -> bool[src]

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

Trait Implementations

impl<'a> Clone for RibKind<'a>[src]

fn clone(&self) -> RibKind<'a>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<'a> Debug for RibKind<'a>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl<'a> Copy for RibKind<'a>[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for RibKind<'a>

impl<'a> !Send for RibKind<'a>

impl<'a> !Sync for RibKind<'a>

impl<'a> Unpin for RibKind<'a>

impl<'a> !UnwindSafe for RibKind<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone, 
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

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

recently added

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.