summaryrefslogtreecommitdiffstats
path: root/src/test/ui/hr-subtype/placeholder-pattern.rs
blob: 061e66e54d2f442541b8fe8cdf2da5a8916845de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// check-pass
// Check that higher ranked subtyping correctly works when using
// placeholder patterns.
fn hr_subtype<'c>(f: for<'a, 'b> fn(&'a (), &'b ())) {
    let _: for<'a> fn(&'a (), &'a ()) = f;
    let _: for<'a, 'b> fn(&'a (), &'b ()) = f;
    let _: for<'a> fn(&'a (), &'c ()) = f;
    let _: fn(&'c (), &'c ()) = f;
}

fn simple<'c>(x: (&'static i32,)) {
    let _: (&'c i32,) = x;
}

fn main() {
    hr_subtype(|_, _| {});
    simple((&3,));
}