1 error[E0631]: type mismatch in closure arguments
2 --> $DIR/closure-arg-type-mismatch.rs:3:14
4 LL | a.iter().map(|_: (u32, u32)| 45);
5 | ^^^ ------------------ found signature of `fn((u32, u32)) -> _`
7 | expected signature of `fn(&(u32, u32)) -> _`
9 error[E0631]: type mismatch in closure arguments
10 --> $DIR/closure-arg-type-mismatch.rs:4:14
12 LL | a.iter().map(|_: &(u16, u16)| 45);
13 | ^^^ ------------------- found signature of `for<'r> fn(&'r (u16, u16)) -> _`
15 | expected signature of `fn(&(u32, u32)) -> _`
17 error[E0631]: type mismatch in closure arguments
18 --> $DIR/closure-arg-type-mismatch.rs:5:14
20 LL | a.iter().map(|_: (u16, u16)| 45);
21 | ^^^ ------------------ found signature of `fn((u16, u16)) -> _`
23 | expected signature of `fn(&(u32, u32)) -> _`
25 error[E0308]: mismatched types
26 --> $DIR/closure-arg-type-mismatch.rs:10:5
29 | ^^^ lifetime mismatch
31 = note: expected type `for<'r> Fn<(*mut &'r u32,)>`
32 found type `Fn<(*mut &'a u32,)>`
33 note: the required lifetime does not necessarily outlive the lifetime `'a` as defined on the function body at 9:10
34 --> $DIR/closure-arg-type-mismatch.rs:9:10
36 LL | fn _test<'a>(f: fn(*mut &'a u32)) {
38 note: the lifetime requirement is introduced here
39 --> $DIR/closure-arg-type-mismatch.rs:8:11
41 LL | fn baz<F: Fn(*mut &u32)>(_: F) {}
44 error: implementation of `FnOnce` is not general enough
45 --> $DIR/closure-arg-type-mismatch.rs:10:5
48 | ^^^ implementation of `FnOnce` is not general enough
50 = note: `fn(*mut &'a u32)` must implement `FnOnce<(*mut &'0 u32,)>`, for any lifetime `'0`...
51 = note: ...but it actually implements `FnOnce<(*mut &'a u32,)>`
53 error[E0308]: mismatched types
54 --> $DIR/closure-arg-type-mismatch.rs:10:5
57 | ^^^ lifetime mismatch
59 = note: expected type `for<'r> Fn<(*mut &'r u32,)>`
60 found type `Fn<(*mut &'a u32,)>`
61 note: the lifetime `'a` as defined on the function body at 9:10 doesn't meet the lifetime requirements
62 --> $DIR/closure-arg-type-mismatch.rs:9:10
64 LL | fn _test<'a>(f: fn(*mut &'a u32)) {
66 note: the lifetime requirement is introduced here
67 --> $DIR/closure-arg-type-mismatch.rs:8:11
69 LL | fn baz<F: Fn(*mut &u32)>(_: F) {}
72 error: implementation of `FnOnce` is not general enough
73 --> $DIR/closure-arg-type-mismatch.rs:10:5
76 | ^^^ implementation of `FnOnce` is not general enough
78 = note: `fn(*mut &'a u32)` must implement `FnOnce<(*mut &'0 u32,)>`, for any lifetime `'0`...
79 = note: ...but it actually implements `FnOnce<(*mut &'a u32,)>`
81 error: aborting due to 7 previous errors
83 Some errors have detailed explanations: E0308, E0631.
84 For more information about an error, try `rustc --explain E0308`.