]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-types/higher-ranked-projection.rs
feat(rustdoc): open sidebar menu when links inside it are focused
[rust.git] / src / test / ui / associated-types / higher-ranked-projection.rs
1 #![feature(rustc_attrs)]
2
3 // revisions: good bad
4
5 trait Mirror {
6     type Image;
7 }
8
9 impl<T> Mirror for T {
10     type Image = T;
11 }
12
13 #[cfg(bad)]
14 fn foo<U, T>(_t: T)
15     where for<'a> &'a T: Mirror<Image=U>
16 {}
17
18 #[cfg(good)]
19 fn foo<U, T>(_t: T)
20     where for<'a> &'a T: Mirror<Image=&'a U>
21 {}
22
23 #[rustc_error]
24 fn main() { //[good]~ ERROR fatal error triggered by #[rustc_error]
25     foo(());
26     //[bad]~^ ERROR mismatched types
27 }