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