]> git.lizzy.rs Git - rust.git/blob - tests/ui/mismatched_types/closure-arg-type-mismatch.stderr
Rollup merge of #106441 - mllken:abstract-socket-noref, r=joshtriplett
[rust.git] / tests / ui / mismatched_types / closure-arg-type-mismatch.stderr
1 error[E0631]: type mismatch in closure arguments
2   --> $DIR/closure-arg-type-mismatch.rs:3:14
3    |
4 LL |     a.iter().map(|_: (u32, u32)| 45);
5    |              ^^^ ---------------
6    |              |   |   |
7    |              |   |   help: consider borrowing the argument: `&(u32, u32)`
8    |              |   found signature defined here
9    |              expected due to this
10    |
11    = note: expected closure signature `fn(&(u32, u32)) -> _`
12               found closure signature `fn((u32, u32)) -> _`
13 note: required by a bound in `map`
14   --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
15
16 error[E0631]: type mismatch in closure arguments
17   --> $DIR/closure-arg-type-mismatch.rs:4:14
18    |
19 LL |     a.iter().map(|_: &(u16, u16)| 45);
20    |              ^^^ ---------------- found signature defined here
21    |              |
22    |              expected due to this
23    |
24    = note: expected closure signature `fn(&(u32, u32)) -> _`
25               found closure signature `for<'a> fn(&'a (u16, u16)) -> _`
26 note: required by a bound in `map`
27   --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
28
29 error[E0631]: type mismatch in closure arguments
30   --> $DIR/closure-arg-type-mismatch.rs:5:14
31    |
32 LL |     a.iter().map(|_: (u16, u16)| 45);
33    |              ^^^ --------------- found signature defined here
34    |              |
35    |              expected due to this
36    |
37    = note: expected closure signature `fn(&(u32, u32)) -> _`
38               found closure signature `fn((u16, u16)) -> _`
39 note: required by a bound in `map`
40   --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
41
42 error: aborting due to 3 previous errors
43
44 For more information about this error, try `rustc --explain E0631`.