]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/crashes/needless_lifetimes_impl_trait.rs
Rollup merge of #86263 - fee1-dead:rustdoc-layout-variants, r=camelid
[rust.git] / src / tools / clippy / tests / ui / crashes / needless_lifetimes_impl_trait.rs
1 #![deny(clippy::needless_lifetimes)]
2 #![allow(dead_code)]
3
4 trait Foo {}
5
6 struct Bar {}
7
8 struct Baz<'a> {
9     bar: &'a Bar,
10 }
11
12 impl<'a> Foo for Baz<'a> {}
13
14 impl Bar {
15     fn baz<'a>(&'a self) -> impl Foo + 'a {
16         Baz { bar: self }
17     }
18 }
19
20 fn main() {}