Skip to content

Commit 5730482

Browse files
authored
Rollup merge of rust-lang#97415 - cjgillot:is-late-bound-solo, r=estebank
Compute `is_late_bound_map` query separately from lifetime resolution This query is actually very simple, and is only useful for functions and method. It can be computed directly by fetching the HIR, with no need to embed it within the lifetime resolution visitor. Based on rust-lang#96296
2 parents baacbfd + 1e86cc5 commit 5730482

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

clippy_lints/src/lifetimes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ impl<'a, 'tcx> RefVisitor<'a, 'tcx> {
371371
if let Some(ref lt) = *lifetime {
372372
if lt.name == LifetimeName::Static {
373373
self.lts.push(RefLt::Static);
374-
} else if let LifetimeName::Param(ParamName::Fresh(_)) = lt.name {
374+
} else if let LifetimeName::Param(_, ParamName::Fresh) = lt.name {
375375
// Fresh lifetimes generated should be ignored.
376376
} else if lt.is_elided() {
377377
self.lts.push(RefLt::Unnamed);

clippy_lints/src/ptr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ impl fmt::Display for RefPrefix {
343343
use fmt::Write;
344344
f.write_char('&')?;
345345
match self.lt {
346-
LifetimeName::Param(ParamName::Plain(name)) => {
346+
LifetimeName::Param(_, ParamName::Plain(name)) => {
347347
name.fmt(f)?;
348348
f.write_char(' ')?;
349349
},

clippy_utils/src/hir_utils.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -902,16 +902,14 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
902902

903903
pub fn hash_lifetime(&mut self, lifetime: Lifetime) {
904904
std::mem::discriminant(&lifetime.name).hash(&mut self.s);
905-
if let LifetimeName::Param(ref name) = lifetime.name {
905+
if let LifetimeName::Param(param_id, ref name) = lifetime.name {
906906
std::mem::discriminant(name).hash(&mut self.s);
907+
param_id.hash(&mut self.s);
907908
match name {
908909
ParamName::Plain(ref ident) => {
909910
ident.name.hash(&mut self.s);
910911
},
911-
ParamName::Fresh(ref size) => {
912-
size.hash(&mut self.s);
913-
},
914-
ParamName::Error => {},
912+
ParamName::Fresh | ParamName::Error => {},
915913
}
916914
}
917915
}

0 commit comments

Comments
 (0)