1
Fork 0

Remove in-band lifetimes

This commit is contained in:
Michael Goulet 2022-02-09 18:42:32 -08:00
parent 4e82f35492
commit bb548a918a
67 changed files with 58 additions and 1459 deletions

View file

@ -15,8 +15,6 @@ use rustc_macros::HashStable;
pub enum LifetimeDefOrigin {
// Explicit binders like `fn foo<'a>(x: &'a u8)` or elided like `impl Foo<&u32>`
ExplicitOrElided,
// In-band declarations like `fn foo(x: &'a u8)`
InBand,
// Some kind of erroneous origin
Error,
}
@ -25,7 +23,6 @@ impl LifetimeDefOrigin {
pub fn from_param(param: &GenericParam<'_>) -> Self {
match param.kind {
GenericParamKind::Lifetime { kind } => match kind {
LifetimeParamKind::InBand => LifetimeDefOrigin::InBand,
LifetimeParamKind::Explicit => LifetimeDefOrigin::ExplicitOrElided,
LifetimeParamKind::Elided => LifetimeDefOrigin::ExplicitOrElided,
LifetimeParamKind::Error => LifetimeDefOrigin::Error,