]> git.lizzy.rs Git - rust.git/blob - src/test/ui/self/self_lifetime.rs
Rollup merge of #105664 - notriddle:notriddle/linkwrap, r=GuillaumeGomez
[rust.git] / src / test / ui / self / self_lifetime.rs
1 // check-pass
2
3 // https://github.com/rust-lang/rust/pull/60944#issuecomment-495346120
4
5 struct Foo<'a>(&'a ());
6 impl<'a> Foo<'a> {
7     fn foo<'b>(self: &'b Foo<'a>) -> &() { self.0 }
8 }
9
10 type Alias = Foo<'static>;
11 impl Alias {
12     fn bar<'a>(self: &Alias, arg: &'a ()) -> &() { arg }
13 }
14
15 fn main() {}