]> git.lizzy.rs Git - rust.git/blob - src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr
Auto merge of #76110 - FedericoPonzi:convert-openoptions-cint, r=JoshTriplett
[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 of `fn((u32, u32)) -> _`
6    |              |
7    |              expected signature of `fn(&(u32, u32)) -> _`
8
9 error[E0631]: type mismatch in closure arguments
10   --> $DIR/closure-arg-type-mismatch.rs:4:14
11    |
12 LL |     a.iter().map(|_: &(u16, u16)| 45);
13    |              ^^^ ------------------- found signature of `for<'r> fn(&'r (u16, u16)) -> _`
14    |              |
15    |              expected signature of `fn(&(u32, u32)) -> _`
16
17 error[E0631]: type mismatch in closure arguments
18   --> $DIR/closure-arg-type-mismatch.rs:5:14
19    |
20 LL |     a.iter().map(|_: (u16, u16)| 45);
21    |              ^^^ ------------------ found signature of `fn((u16, u16)) -> _`
22    |              |
23    |              expected signature of `fn(&(u32, u32)) -> _`
24
25 error[E0308]: mismatched types
26   --> $DIR/closure-arg-type-mismatch.rs:10:5
27    |
28 LL |     baz(f);
29    |     ^^^ one type is more general than the other
30    |
31    = note: expected type `for<'r> Fn<(*mut &'r u32,)>`
32               found type `Fn<(*mut &'a u32,)>`
33
34 error[E0308]: mismatched types
35   --> $DIR/closure-arg-type-mismatch.rs:10:5
36    |
37 LL |     baz(f);
38    |     ^^^ one type is more general than the other
39    |
40    = note: expected type `FnOnce<(*mut &u32,)>`
41               found type `FnOnce<(*mut &'a u32,)>`
42
43 error[E0308]: mismatched types
44   --> $DIR/closure-arg-type-mismatch.rs:10:5
45    |
46 LL |     baz(f);
47    |     ^^^ one type is more general than the other
48    |
49    = note: expected type `for<'r> Fn<(*mut &'r u32,)>`
50               found type `Fn<(*mut &'a u32,)>`
51
52 error[E0308]: mismatched types
53   --> $DIR/closure-arg-type-mismatch.rs:10:5
54    |
55 LL |     baz(f);
56    |     ^^^ one type is more general than the other
57    |
58    = note: expected type `FnOnce<(*mut &u32,)>`
59               found type `FnOnce<(*mut &'a u32,)>`
60
61 error: aborting due to 7 previous errors
62
63 Some errors have detailed explanations: E0308, E0631.
64 For more information about an error, try `rustc --explain E0308`.