pub(crate) enum RegionNameSource {
NamedEarlyBoundRegion(Span),
NamedFreeRegion(Span),
Static,
SynthesizedFreeEnvRegion(Span, String),
AnonRegionFromArgument(RegionNameHighlight),
AnonRegionFromUpvar(Span, String),
AnonRegionFromOutput(RegionNameHighlight, String),
AnonRegionFromYieldTy(Span, String),
AnonRegionFromAsyncFn(Span),
}Expand description
Denotes the source of a region that is named by a RegionName. For example, a free region that
was named by the user would get NamedFreeRegion and 'static lifetime would get Static.
This helps to print the right kinds of diagnostics.
Variants
NamedEarlyBoundRegion(Span)
A bound (not free) region that was substituted at the def site (not an HRTB).
NamedFreeRegion(Span)
A free region that the user has a name ('a) for.
Static
The 'static region.
SynthesizedFreeEnvRegion(Span, String)
The free region corresponding to the environment of a closure.
AnonRegionFromArgument(RegionNameHighlight)
The region corresponding to an argument.
AnonRegionFromUpvar(Span, String)
The region corresponding to a closure upvar.
AnonRegionFromOutput(RegionNameHighlight, String)
The region corresponding to the return type of a closure.
AnonRegionFromYieldTy(Span, String)
The region from a type yielded by a generator.
AnonRegionFromAsyncFn(Span)
An anonymous region from an async fn.
Trait Implementations
sourceimpl Clone for RegionNameSource
impl Clone for RegionNameSource
sourcefn clone(&self) -> RegionNameSource
fn clone(&self) -> RegionNameSource
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
Auto Trait Implementations
impl RefUnwindSafe for RegionNameSource
impl !Send for RegionNameSource
impl !Sync for RegionNameSource
impl Unpin for RegionNameSource
impl UnwindSafe for RegionNameSource
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more
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: 72 bytes
Size for each variant:
NamedEarlyBoundRegion: 8 bytesNamedFreeRegion: 8 bytesStatic: 0 bytesSynthesizedFreeEnvRegion: 36 bytesAnonRegionFromArgument: 44 bytesAnonRegionFromUpvar: 36 bytesAnonRegionFromOutput: 68 bytesAnonRegionFromYieldTy: 36 bytesAnonRegionFromAsyncFn: 8 bytes