pub enum LifetimeElisionKind<'db> {
AnonymousCreateParameter {
report_in_path: bool,
},
Elided(Region<'db>),
AnonymousReportError,
StaticIfNoLifetimeInScope {
only_lint: bool,
},
ElisionFailure,
Infer,
}Variants§
AnonymousCreateParameter
Create a new anonymous lifetime parameter and reference it.
If report_in_path, report an error when encountering lifetime elision in a path:
struct Foo<'a> { x: &'a () }
async fn foo(x: Foo) {}Note: the error should not trigger when the elided lifetime is in a pattern or expression-position path:
struct Foo<'a> { x: &'a () }
async fn foo(Foo { x: _ }: Foo<'_>) {}Elided(Region<'db>)
Replace all anonymous lifetimes by provided lifetime.
AnonymousReportError
Give a hard error when either & or '_ is written. Used to
rule out things like where T: Foo<'_>. Does not imply an
error on default object bounds (e.g., Box<dyn Foo>).
StaticIfNoLifetimeInScope
Resolves elided lifetimes to 'static if there are no other lifetimes in scope,
otherwise give a warning that the previous behavior of introducing a new early-bound
lifetime is a bug and will be removed (if only_lint is enabled).
ElisionFailure
Signal we cannot find which should be the anonymous lifetime.
Infer
Infer all elided lifetimes.
Trait Implementations§
Source§impl<'db> Clone for LifetimeElisionKind<'db>
impl<'db> Clone for LifetimeElisionKind<'db>
Source§fn clone(&self) -> LifetimeElisionKind<'db>
fn clone(&self) -> LifetimeElisionKind<'db>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<'db> Freeze for LifetimeElisionKind<'db>
impl<'db> RefUnwindSafe for LifetimeElisionKind<'db>
impl<'db> Send for LifetimeElisionKind<'db>
impl<'db> Sync for LifetimeElisionKind<'db>
impl<'db> Unpin for LifetimeElisionKind<'db>
impl<'db> UnwindSafe for LifetimeElisionKind<'db>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more