]> git.lizzy.rs Git - rust.git/blob - tests/ui/crashes/needless_lifetimes_impl_trait.rs
Merge pull request #3918 from matthiaskrgr/typos
[rust.git] / tests / ui / crashes / needless_lifetimes_impl_trait.rs
1 // run-pass
2
3 #![deny(clippy::needless_lifetimes)]
4 #![allow(dead_code)]
5
6 trait Foo {}
7
8 struct Bar {}
9
10 struct Baz<'a> {
11     bar: &'a Bar,
12 }
13
14 impl<'a> Foo for Baz<'a> {}
15
16 impl Bar {
17     fn baz<'a>(&'a self) -> impl Foo + 'a {
18         Baz { bar: self }
19     }
20 }
21
22 fn main() {}