Skip to content

Commit c31637e

Browse files
Rollup merge of #99728 - cjgillot:ast-lifetimes-anon-clean, r=petrochenkov
Clean up HIR-based lifetime resolution Based on rust-lang/rust#97313. Fixes #98932. r? `@petrochenkov`
2 parents 2572591 + 8edcf6c commit c31637e

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

clippy_lints/src/lifetimes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ struct BodyLifetimeChecker {
615615
impl<'tcx> Visitor<'tcx> for BodyLifetimeChecker {
616616
// for lifetimes as parameters of generics
617617
fn visit_lifetime(&mut self, lifetime: &'tcx Lifetime) {
618-
if lifetime.name.ident().name != kw::Empty && lifetime.name.ident().name != kw::StaticLifetime {
618+
if lifetime.name.ident().name != kw::UnderscoreLifetime && lifetime.name.ident().name != kw::StaticLifetime {
619619
self.lifetimes_used_in_body = true;
620620
}
621621
}

clippy_lints/src/manual_async_fn.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ fn captures_all_lifetimes(inputs: &[Ty<'_>], output_lifetimes: &[LifetimeName])
166166
// - There's only one output lifetime bound using `+ '_`
167167
// - All input lifetimes are explicitly bound to the output
168168
input_lifetimes.is_empty()
169-
|| (output_lifetimes.len() == 1 && matches!(output_lifetimes[0], LifetimeName::Underscore))
169+
|| (output_lifetimes.len() == 1 && matches!(output_lifetimes[0], LifetimeName::Infer))
170170
|| input_lifetimes
171171
.iter()
172172
.all(|in_lt| output_lifetimes.iter().any(|out_lt| in_lt == out_lt))

clippy_lints/src/ptr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ impl fmt::Display for RefPrefix {
351351
name.fmt(f)?;
352352
f.write_char(' ')?;
353353
},
354-
LifetimeName::Underscore => f.write_str("'_ ")?,
354+
LifetimeName::Infer => f.write_str("'_ ")?,
355355
LifetimeName::Static => f.write_str("'static ")?,
356356
_ => (),
357357
}

0 commit comments

Comments
 (0)