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 note: required by a bound in `map`
10 --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
12 LL | F: FnMut(Self::Item) -> B,
13 | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map`
15 error[E0631]: type mismatch in closure arguments
16 --> $DIR/closure-arg-type-mismatch.rs:4:14
18 LL | a.iter().map(|_: &(u16, u16)| 45);
19 | ^^^ ------------------- found signature of `for<'r> fn(&'r (u16, u16)) -> _`
21 | expected signature of `fn(&(u32, u32)) -> _`
23 note: required by a bound in `map`
24 --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
26 LL | F: FnMut(Self::Item) -> B,
27 | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map`
29 error[E0631]: type mismatch in closure arguments
30 --> $DIR/closure-arg-type-mismatch.rs:5:14
32 LL | a.iter().map(|_: (u16, u16)| 45);
33 | ^^^ ------------------ found signature of `fn((u16, u16)) -> _`
35 | expected signature of `fn(&(u32, u32)) -> _`
37 note: required by a bound in `map`
38 --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
40 LL | F: FnMut(Self::Item) -> B,
41 | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map`
43 error[E0308]: mismatched types
44 --> $DIR/closure-arg-type-mismatch.rs:10:5
47 | ^^^ lifetime mismatch
49 = note: expected type `for<'r> Fn<(*mut &'r u32,)>`
50 found type `Fn<(*mut &'a u32,)>`
51 note: the required lifetime does not necessarily outlive the lifetime `'a` as defined here
52 --> $DIR/closure-arg-type-mismatch.rs:9:10
54 LL | fn _test<'a>(f: fn(*mut &'a u32)) {
56 note: the lifetime requirement is introduced here
57 --> $DIR/closure-arg-type-mismatch.rs:8:11
59 LL | fn baz<F: Fn(*mut &u32)>(_: F) {}
62 error: implementation of `FnOnce` is not general enough
63 --> $DIR/closure-arg-type-mismatch.rs:10:5
66 | ^^^ implementation of `FnOnce` is not general enough
68 = note: `fn(*mut &'a u32)` must implement `FnOnce<(*mut &'0 u32,)>`, for any lifetime `'0`...
69 = note: ...but it actually implements `FnOnce<(*mut &'a u32,)>`
71 error[E0308]: mismatched types
72 --> $DIR/closure-arg-type-mismatch.rs:10:5
75 | ^^^ lifetime mismatch
77 = note: expected type `for<'r> Fn<(*mut &'r u32,)>`
78 found type `Fn<(*mut &'a u32,)>`
79 note: the lifetime `'a` as defined here doesn't meet the lifetime requirements
80 --> $DIR/closure-arg-type-mismatch.rs:9:10
82 LL | fn _test<'a>(f: fn(*mut &'a u32)) {
84 note: the lifetime requirement is introduced here
85 --> $DIR/closure-arg-type-mismatch.rs:8:11
87 LL | fn baz<F: Fn(*mut &u32)>(_: F) {}
90 error: implementation of `FnOnce` is not general enough
91 --> $DIR/closure-arg-type-mismatch.rs:10:5
94 | ^^^ implementation of `FnOnce` is not general enough
96 = note: `fn(*mut &'a u32)` must implement `FnOnce<(*mut &'0 u32,)>`, for any lifetime `'0`...
97 = note: ...but it actually implements `FnOnce<(*mut &'a u32,)>`
99 error: aborting due to 7 previous errors
101 Some errors have detailed explanations: E0308, E0631.
102 For more information about an error, try `rustc --explain E0308`.