]> git.proxmox.com Git - rustc.git/blame - src/test/ui/anonymous-higher-ranked-lifetime.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / anonymous-higher-ranked-lifetime.rs
CommitLineData
abe05a73 1fn 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
16fn f1<F>(_: F) where F: Fn(&(), &()) {}
17fn f2<F>(_: F) where F: for<'a> Fn(&'a (), &()) {}
18fn f3<'a, F>(_: F) where F: Fn(&'a (), &()) {}
19fn f4<F>(_: F) where F: for<'r> Fn(&(), &'r ()) {}
20fn f5<F>(_: F) where F: for<'r> Fn(&'r (), &'r ()) {}
21
22// Nested
dc9dc135 23fn g1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>) {}
abe05a73 24fn g2<F>(_: F) where F: Fn(&(), fn(&())) {}
dc9dc135 25fn g3<F>(_: F) where F: for<'s> Fn(&'s (), Box<dyn Fn(&())>) {}
abe05a73
XL
26fn g4<F>(_: F) where F: Fn(&(), for<'r> fn(&'r ())) {}
27
28// Mixed
dc9dc135
XL
29fn h1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>, &(), fn(&(), &())) {}
30fn h2<F>(_: F) where F: for<'t0> Fn(&(), Box<dyn Fn(&())>, &'t0 (), fn(&(), &())) {}