]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-47511.rs
point at private fields in struct literal
[rust.git] / src / test / ui / issues / issue-47511.rs
1 // check-fail
2 // known-bug
3
4 // Regression test for #47511: anonymous lifetimes can appear
5 // unconstrained in a return type, but only if they appear just once
6 // in the input, as the input to a projection.
7
8 fn f(_: X) -> X {
9     unimplemented!()
10 }
11
12 fn g<'a>(_: X<'a>) -> X<'a> {
13     unimplemented!()
14 }
15
16 type X<'a> = <&'a () as Trait>::Value;
17
18 trait Trait {
19     type Value;
20 }
21
22 impl<'a> Trait for &'a () {
23     type Value = ();
24 }
25
26 fn main() {}