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