Enum rustc_mir::borrow_check::universal_regions::RegionClassification[−][src]

pub enum RegionClassification {
    Global,
    External,
    Local,
}

Variants

Global
Expand description

A global region is one that can be named from anywhere. There is only one, 'static.

External
Expand description

An external region is only relevant for closures. In that case, it refers to regions that are free in the closure type – basically, something bound in the surrounding context.

Consider this example:

fn foo<'a, 'b>(a: &'a u32, b: &'b u32, c: &'static u32) {
  let closure = for<'x> |x: &'x u32| { .. };
                ^^^^^^^ pretend this were legal syntax
                        for declaring a late-bound region in
                        a closure signature
}

Here, the lifetimes 'a and 'b would be external to the closure.

If we are not analyzing a closure, there are no external lifetimes.

Local
Expand description

A local lifetime is one about which we know the full set of relevant constraints (that is, relationships to other named regions). For a closure, this includes any region bound in the closure’s signature. For a fn item, this includes all regions other than global ones.

Continuing with the example from External, if we were analyzing the closure, then 'x would be local (and 'a and 'b are external). If we are analyzing the function item foo, then 'a and 'b are local (and 'x is not in scope).

Trait Implementations

impl Debug for RegionClassification[src]

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

Formats the value using the given formatter. Read more

impl PartialEq<RegionClassification> for RegionClassification[src]

fn eq(&self, other: &RegionClassification) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl StructuralPartialEq for RegionClassification[src]

Auto Trait Implementations

impl RefUnwindSafe for RegionClassification

impl Send for RegionClassification

impl Sync for RegionClassification

impl Unpin for RegionClassification

impl UnwindSafe for RegionClassification

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

impl<T> WithConstness for T[src]

fn with_constness(self, constness: Constness) -> ConstnessAnd<Self>[src]

fn with_const(self) -> ConstnessAnd<Self>[src]

fn without_const(self) -> ConstnessAnd<Self>[src]