summaryrefslogtreecommitdiffstats
path: root/src/test/ui/associated-types/higher-ranked-projection.rs
blob: 7e6c509a2722d4857e460c32d6c38e8f33ba1f5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// revisions: good bad
//[good] check-pass

trait Mirror {
    type Image;
}

impl<T> Mirror for T {
    type Image = T;
}

#[cfg(bad)]
fn foo<U, T>(_t: T)
    where for<'a> &'a T: Mirror<Image=U>
{}

#[cfg(good)]
fn foo<U, T>(_t: T)
    where for<'a> &'a T: Mirror<Image=&'a U>
{}

fn main() {
    foo(());
    //[bad]~^ ERROR mismatched types
}