os-rust/tests/ui/regions/transitively-redundant-lifetimes.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
548 B
Rust
Raw Normal View History

#![deny(redundant_lifetimes)]
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 &()) {}
trait Tr<'a> {}
impl<'a: 'static> Tr<'a> for () {} //~ ERROR unnecessary lifetime parameter `'a`
fn main() {}