]> git.lizzy.rs Git - rust.git/blob - src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr
Merge commit 'f4850f7292efa33759b4f7f9b7621268979e9914' into clippyup
[rust.git] / src / test / 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    |              ^^^ --------------- found signature defined here
6    |              |
7    |              expected due to this
8    |
9    = note: expected closure signature `fn(&(u32, u32)) -> _`
10               found closure signature `fn((u32, u32)) -> _`
11 note: required by a bound in `map`
12   --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
13    |
14 LL |         F: FnMut(Self::Item) -> B,
15    |            ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map`
16
17 error[E0631]: type mismatch in closure arguments
18   --> $DIR/closure-arg-type-mismatch.rs:4:14
19    |
20 LL |     a.iter().map(|_: &(u16, u16)| 45);
21    |              ^^^ ---------------- found signature defined here
22    |              |
23    |              expected due to this
24    |
25    = note: expected closure signature `fn(&(u32, u32)) -> _`
26               found closure signature `for<'a> fn(&'a (u16, u16)) -> _`
27 note: required by a bound in `map`
28   --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
29    |
30 LL |         F: FnMut(Self::Item) -> B,
31    |            ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map`
32
33 error[E0631]: type mismatch in closure arguments
34   --> $DIR/closure-arg-type-mismatch.rs:5:14
35    |
36 LL |     a.iter().map(|_: (u16, u16)| 45);
37    |              ^^^ --------------- found signature defined here
38    |              |
39    |              expected due to this
40    |
41    = note: expected closure signature `fn(&(u32, u32)) -> _`
42               found closure signature `fn((u16, u16)) -> _`
43 note: required by a bound in `map`
44   --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
45    |
46 LL |         F: FnMut(Self::Item) -> B,
47    |            ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map`
48
49 error: aborting due to 3 previous errors
50
51 For more information about this error, try `rustc --explain E0631`.