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

pub enum RegionClassification {



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


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.


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]

impl PartialEq<RegionClassification> for RegionClassification[src]

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

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

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

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

The type returned in the event of a conversion error.

impl<T> WithConstness for T[src]