Fix lifetimes elision suggestion in where clauses (#13752)
Fix #13749 changelog: [`needless_lifetimes`]: do not suggest using `'_` in `where` clauses
This commit is contained in:
commit
74dd50c653
3 changed files with 28 additions and 6 deletions
|
|
@ -658,12 +658,6 @@ fn report_elidable_impl_lifetimes<'tcx>(
|
|||
lifetime,
|
||||
in_where_predicate: false,
|
||||
..
|
||||
}
|
||||
| Usage {
|
||||
lifetime,
|
||||
in_bounded_ty: false,
|
||||
in_generics_arg: false,
|
||||
..
|
||||
},
|
||||
] = usages.as_slice()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -562,4 +562,18 @@ mod rayon {
|
|||
}
|
||||
}
|
||||
|
||||
mod issue13749 {
|
||||
pub struct Generic<T>(T);
|
||||
// Non elidable lifetime
|
||||
#[expect(clippy::extra_unused_lifetimes)]
|
||||
impl<'a, T> Generic<T> where T: 'a {}
|
||||
}
|
||||
|
||||
mod issue13749bis {
|
||||
pub struct Generic<T>(T);
|
||||
// Non elidable lifetime
|
||||
#[expect(clippy::extra_unused_lifetimes)]
|
||||
impl<'a, T: 'a> Generic<T> {}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -562,4 +562,18 @@ mod rayon {
|
|||
}
|
||||
}
|
||||
|
||||
mod issue13749 {
|
||||
pub struct Generic<T>(T);
|
||||
// Non elidable lifetime
|
||||
#[expect(clippy::extra_unused_lifetimes)]
|
||||
impl<'a, T> Generic<T> where T: 'a {}
|
||||
}
|
||||
|
||||
mod issue13749bis {
|
||||
pub struct Generic<T>(T);
|
||||
// Non elidable lifetime
|
||||
#[expect(clippy::extra_unused_lifetimes)]
|
||||
impl<'a, T: 'a> Generic<T> {}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue