]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-types/higher-ranked-projection.rs
Auto merge of #106143 - matthiaskrgr:rollup-3kpy1dc, r=matthiaskrgr
[rust.git] / src / test / ui / associated-types / higher-ranked-projection.rs
1 // revisions: good bad
2 //[good] check-pass
3
4 trait Mirror {
5     type Image;
6 }
7
8 impl<T> Mirror for T {
9     type Image = T;
10 }
11
12 #[cfg(bad)]
13 fn foo<U, T>(_t: T)
14     where for<'a> &'a T: Mirror<Image=U>
15 {}
16
17 #[cfg(good)]
18 fn foo<U, T>(_t: T)
19     where for<'a> &'a T: Mirror<Image=&'a U>
20 {}
21
22 fn main() {
23     foo(());
24     //[bad]~^ ERROR mismatched types
25 }