]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/issue-68649-pass.rs
Rollup merge of #102954 - GuillaumeGomez:cfg-hide-attr-checks, r=Manishearth
[rust.git] / src / test / ui / generic-associated-types / issue-68649-pass.rs
1 // check-pass
2
3 trait Fun {
4     type F<'a>;
5
6     fn identity<'a>(t: Self::F<'a>) -> Self::F<'a> { t }
7 }
8
9 impl <T> Fun for T {
10     type F<'a> = Self;
11 }
12
13 fn bug<'a, T: Fun<F<'a> = T>>(t: T) -> T::F<'a> {
14     T::identity(t)
15 }
16
17
18 fn main() {
19     let x = 10;
20
21     bug(x);
22 }