error[E0631]: type mismatch in closure arguments --> $DIR/closure-arg-type-mismatch.rs:3:14 | LL | a.iter().map(|_: (u32, u32)| 45); | ^^^ ------------------ found signature of `fn((u32, u32)) -> _` | | | expected signature of `fn(&(u32, u32)) -> _` | note: required by a bound in `map` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL | LL | F: FnMut(Self::Item) -> B, | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map` error[E0631]: type mismatch in closure arguments --> $DIR/closure-arg-type-mismatch.rs:4:14 | LL | a.iter().map(|_: &(u16, u16)| 45); | ^^^ ------------------- found signature of `for<'r> fn(&'r (u16, u16)) -> _` | | | expected signature of `fn(&(u32, u32)) -> _` | note: required by a bound in `map` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL | LL | F: FnMut(Self::Item) -> B, | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map` error[E0631]: type mismatch in closure arguments --> $DIR/closure-arg-type-mismatch.rs:5:14 | LL | a.iter().map(|_: (u16, u16)| 45); | ^^^ ------------------ found signature of `fn((u16, u16)) -> _` | | | expected signature of `fn(&(u32, u32)) -> _` | note: required by a bound in `map` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL | LL | F: FnMut(Self::Item) -> B, | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map` error[E0308]: mismatched types --> $DIR/closure-arg-type-mismatch.rs:10:5 | LL | baz(f); | ^^^ lifetime mismatch | = note: expected type `for<'r> Fn<(*mut &'r u32,)>` found type `Fn<(*mut &'a u32,)>` note: the required lifetime does not necessarily outlive the lifetime `'a` as defined here --> $DIR/closure-arg-type-mismatch.rs:9:10 | LL | fn _test<'a>(f: fn(*mut &'a u32)) { | ^^ note: the lifetime requirement is introduced here --> $DIR/closure-arg-type-mismatch.rs:8:11 | LL | fn baz(_: F) {} | ^^^^^^^^^^^^^ error: implementation of `FnOnce` is not general enough --> $DIR/closure-arg-type-mismatch.rs:10:5 | LL | baz(f); | ^^^ implementation of `FnOnce` is not general enough | = note: `fn(*mut &'a u32)` must implement `FnOnce<(*mut &'0 u32,)>`, for any lifetime `'0`... = note: ...but it actually implements `FnOnce<(*mut &'a u32,)>` error[E0308]: mismatched types --> $DIR/closure-arg-type-mismatch.rs:10:5 | LL | baz(f); | ^^^ lifetime mismatch | = note: expected type `for<'r> Fn<(*mut &'r u32,)>` found type `Fn<(*mut &'a u32,)>` note: the lifetime `'a` as defined here doesn't meet the lifetime requirements --> $DIR/closure-arg-type-mismatch.rs:9:10 | LL | fn _test<'a>(f: fn(*mut &'a u32)) { | ^^ note: the lifetime requirement is introduced here --> $DIR/closure-arg-type-mismatch.rs:8:11 | LL | fn baz(_: F) {} | ^^^^^^^^^^^^^ error: implementation of `FnOnce` is not general enough --> $DIR/closure-arg-type-mismatch.rs:10:5 | LL | baz(f); | ^^^ implementation of `FnOnce` is not general enough | = note: `fn(*mut &'a u32)` must implement `FnOnce<(*mut &'0 u32,)>`, for any lifetime `'0`... = note: ...but it actually implements `FnOnce<(*mut &'a u32,)>` error: aborting due to 7 previous errors Some errors have detailed explanations: E0308, E0631. For more information about an error, try `rustc --explain E0308`.