]> git.lizzy.rs Git - rust.git/blob - tests/ui/hr-subtype/placeholder-pattern.rs
Rollup merge of #106717 - klensy:typo, r=lcnr
[rust.git] / tests / ui / hr-subtype / placeholder-pattern.rs
1 // check-pass
2 // Check that higher ranked subtyping correctly works when using
3 // placeholder patterns.
4 fn hr_subtype<'c>(f: for<'a, 'b> fn(&'a (), &'b ())) {
5     let _: for<'a> fn(&'a (), &'a ()) = f;
6     let _: for<'a, 'b> fn(&'a (), &'b ()) = f;
7     let _: for<'a> fn(&'a (), &'c ()) = f;
8     let _: fn(&'c (), &'c ()) = f;
9 }
10
11 fn simple<'c>(x: (&'static i32,)) {
12     let _: (&'c i32,) = x;
13 }
14
15 fn main() {
16     hr_subtype(|_, _| {});
17     simple((&3,));
18 }