pub(crate) enum RegionNameSource {
NamedEarlyBoundRegion(Span),
NamedFreeRegion(Span),
Static,
SynthesizedFreeEnvRegion(Span, &'static str),
AnonRegionFromArgument(RegionNameHighlight),
AnonRegionFromUpvar(Span, Symbol),
AnonRegionFromOutput(RegionNameHighlight, &'static str),
AnonRegionFromYieldTy(Span, String),
AnonRegionFromAsyncFn(Span),
AnonRegionFromImplSignature(Span, &'static str),
}
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 instantiated 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, &'static str)
The free region corresponding to the environment of a closure.
AnonRegionFromArgument(RegionNameHighlight)
The region corresponding to an argument.
AnonRegionFromUpvar(Span, Symbol)
The region corresponding to a closure upvar.
AnonRegionFromOutput(RegionNameHighlight, &'static str)
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.
AnonRegionFromImplSignature(Span, &'static str)
An anonymous region from an impl self type or trait
Trait Implementations§
source§impl Clone for RegionNameSource
impl Clone for RegionNameSource
source§fn clone(&self) -> RegionNameSource
fn clone(&self) -> RegionNameSource
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl RefUnwindSafe for RegionNameSource
impl !Send for RegionNameSource
impl !Sync for RegionNameSource
impl Unpin for RegionNameSource
impl UnwindSafe for RegionNameSource
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
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: 56 bytes
Size for each variant:
NamedEarlyBoundRegion
: 12 bytesNamedFreeRegion
: 12 bytesStatic
: 0 bytesSynthesizedFreeEnvRegion
: 32 bytesAnonRegionFromArgument
: 48 bytesAnonRegionFromUpvar
: 16 bytesAnonRegionFromOutput
: 56 bytesAnonRegionFromYieldTy
: 40 bytesAnonRegionFromAsyncFn
: 12 bytesAnonRegionFromImplSignature
: 32 bytes