]> git.proxmox.com Git - rustc.git/blob - src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr
New upstream version 1.41.1+dfsg1
[rustc.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[E0631]: type mismatch in function arguments
26 --> $DIR/closure-arg-type-mismatch.rs:10:9
27 |
28 LL | fn baz<F: Fn(*mut &u32)>(_: F) {}
29 | --- ------------- required by this bound in `baz`
30 LL | fn _test<'a>(f: fn(*mut &'a u32)) {
31 LL | baz(f);
32 | ^
33 | |
34 | expected signature of `for<'r> fn(*mut &'r u32) -> _`
35 | found signature of `fn(*mut &'a u32) -> _`
36
37 error[E0271]: type mismatch resolving `for<'r> <fn(*mut &'a u32) as std::ops::FnOnce<(*mut &'r u32,)>>::Output == ()`
38 --> $DIR/closure-arg-type-mismatch.rs:10:5
39 |
40 LL | fn baz<F: Fn(*mut &u32)>(_: F) {}
41 | --- ------------- required by this bound in `baz`
42 LL | fn _test<'a>(f: fn(*mut &'a u32)) {
43 LL | baz(f);
44 | ^^^ expected bound lifetime parameter, found concrete lifetime
45
46 error: aborting due to 5 previous errors
47
48 Some errors have detailed explanations: E0271, E0631.
49 For more information about an error, try `rustc --explain E0271`.