2023-12-16 01:58:26 +00:00
|
|
|
#![deny(redundant_lifetimes)]
|
2023-11-27 21:54:03 +00:00
|
|
|
|
|
|
|
fn a<'a, 'b>(x: &'a &'b &'a ()) {} //~ ERROR unnecessary lifetime parameter `'b`
|
|
|
|
|
|
|
|
fn b<'a: 'b, 'b: 'a>() {} //~ ERROR unnecessary lifetime parameter `'b`
|
|
|
|
|
|
|
|
struct Foo<T: 'static>(T);
|
|
|
|
fn c<'a>(_: Foo<&'a ()>) {} //~ ERROR unnecessary lifetime parameter `'a`
|
|
|
|
|
|
|
|
struct Bar<'a>(&'a ());
|
|
|
|
impl<'a> Bar<'a> {
|
|
|
|
fn d<'b: 'a>(&'b self) {} //~ ERROR unnecessary lifetime parameter `'b`
|
|
|
|
}
|
|
|
|
|
2023-11-29 02:41:31 +00:00
|
|
|
fn ok(x: &'static &()) {}
|
|
|
|
|
2023-12-05 16:32:47 +00:00
|
|
|
trait Tr<'a> {}
|
|
|
|
impl<'a: 'static> Tr<'a> for () {} //~ ERROR unnecessary lifetime parameter `'a`
|
|
|
|
|
2023-11-27 21:54:03 +00:00
|
|
|
fn main() {}
|