]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/issue-68648-1.rs
Auto merge of #99612 - yanchen4791:issue-95079-fix, r=compiler-errors
[rust.git] / src / test / ui / generic-associated-types / issue-68648-1.rs
1 // check-pass
2
3 #![feature(generic_associated_types)]
4
5
6 trait Fun {
7     type F<'a>;
8
9     fn identity<'a>(t: Self::F<'a>) -> Self::F<'a> { t }
10 }
11
12 impl <T> Fun for T {
13     type F<'a> = Self;
14 }
15
16 fn bug<'a, T: for<'b> Fun<F<'b> = T>>(t: T) -> T::F<'a> {
17     T::identity(t)
18 }
19
20
21 fn main() {
22     let x = 10;
23
24     bug(x);
25 }