]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-25810.rs
Rollup merge of #92942 - Xaeroxe:raw_arg, r=dtolnay
[rust.git] / src / test / ui / issues / issue-25810.rs
1 // run-pass
2 fn main() {
3     let x = X(15);
4     let y = x.foo();
5     println!("{:?}",y);
6 }
7
8 trait Foo
9     where for<'a> &'a Self: Bar
10 {
11     fn foo<'a>(&'a self) -> <&'a Self as Bar>::Output;
12 }
13
14 trait Bar {
15     type Output;
16 }
17
18 struct X(i32);
19
20 impl<'a> Bar for &'a X {
21     type Output = &'a i32;
22 }
23
24 impl Foo for X {
25     fn foo<'a>(&'a self) -> <&'a Self as Bar>::Output {
26         &self.0
27     }
28 }