1 // Check that incorrect higher ranked subtyping
3 struct Inv<'a>(fn(&'a ()) -> &'a ());
4 fn hr_subtype<'c>(f: for<'a, 'b> fn(Inv<'a>, Inv<'a>)) {
6 let _: for<'a> fn(Inv<'a>, Inv<'a>) = f;
7 let sub: for<'a> fn(Inv<'a>, Inv<'a>) = f;
9 let _: for<'a, 'b> fn(Inv<'a>, Inv<'b>) = sub;
10 //~^ ERROR mismatched types
13 fn simple1<'c>(x: (&'c i32,)) {
14 let _x: (&'static i32,) = x;
17 fn simple2<'c>(x: (&'c i32,)) {
18 let _: (&'static i32,) = x;
22 hr_subtype(|_, _| {});