]>
Commit | Line | Data |
---|---|---|
abe05a73 | 1 | fn main() { |
ff7c6d11 XL |
2 | f1(|_: (), _: ()| {}); //~ ERROR type mismatch |
3 | f2(|_: (), _: ()| {}); //~ ERROR type mismatch | |
4 | f3(|_: (), _: ()| {}); //~ ERROR type mismatch | |
5 | f4(|_: (), _: ()| {}); //~ ERROR type mismatch | |
6 | f5(|_: (), _: ()| {}); //~ ERROR type mismatch | |
7 | g1(|_: (), _: ()| {}); //~ ERROR type mismatch | |
8 | g2(|_: (), _: ()| {}); //~ ERROR type mismatch | |
9 | g3(|_: (), _: ()| {}); //~ ERROR type mismatch | |
10 | g4(|_: (), _: ()| {}); //~ ERROR type mismatch | |
11 | h1(|_: (), _: (), _: (), _: ()| {}); //~ ERROR type mismatch | |
12 | h2(|_: (), _: (), _: (), _: ()| {}); //~ ERROR type mismatch | |
abe05a73 XL |
13 | } |
14 | ||
15 | // Basic | |
16 | fn f1<F>(_: F) where F: Fn(&(), &()) {} | |
17 | fn f2<F>(_: F) where F: for<'a> Fn(&'a (), &()) {} | |
18 | fn f3<'a, F>(_: F) where F: Fn(&'a (), &()) {} | |
19 | fn f4<F>(_: F) where F: for<'r> Fn(&(), &'r ()) {} | |
20 | fn f5<F>(_: F) where F: for<'r> Fn(&'r (), &'r ()) {} | |
21 | ||
22 | // Nested | |
dc9dc135 | 23 | fn g1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>) {} |
abe05a73 | 24 | fn g2<F>(_: F) where F: Fn(&(), fn(&())) {} |
dc9dc135 | 25 | fn g3<F>(_: F) where F: for<'s> Fn(&'s (), Box<dyn Fn(&())>) {} |
abe05a73 XL |
26 | fn g4<F>(_: F) where F: Fn(&(), for<'r> fn(&'r ())) {} |
27 | ||
28 | // Mixed | |
dc9dc135 XL |
29 | fn h1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>, &(), fn(&(), &())) {} |
30 | fn h2<F>(_: F) where F: for<'t0> Fn(&(), Box<dyn Fn(&())>, &'t0 (), fn(&(), &())) {} |