]> git.proxmox.com Git - rustc.git/blob - src/test/ui/fn/fn-trait-formatting.stderr
New upstream version 1.48.0~beta.8+dfsg1
[rustc.git] / src / test / ui / fn / fn-trait-formatting.stderr
1 error[E0308]: mismatched types
2 --> $DIR/fn-trait-formatting.rs:6:17
3 |
4 LL | let _: () = (box |_: isize| {}) as Box<dyn FnOnce(isize)>;
5 | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `Box`
6 | |
7 | expected due to this
8 |
9 = note: expected unit type `()`
10 found struct `Box<dyn FnOnce(isize)>`
11
12 error[E0308]: mismatched types
13 --> $DIR/fn-trait-formatting.rs:10:17
14 |
15 LL | let _: () = (box |_: isize, isize| {}) as Box<dyn Fn(isize, isize)>;
16 | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `Box`
17 | |
18 | expected due to this
19 |
20 = note: expected unit type `()`
21 found struct `Box<dyn Fn(isize, isize)>`
22
23 error[E0308]: mismatched types
24 --> $DIR/fn-trait-formatting.rs:14:17
25 |
26 LL | let _: () = (box || -> isize { unimplemented!() }) as Box<dyn FnMut() -> isize>;
27 | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `Box`
28 | |
29 | expected due to this
30 |
31 = note: expected unit type `()`
32 found struct `Box<dyn FnMut() -> isize>`
33
34 error[E0277]: expected a `Fn<(isize,)>` closure, found `{integer}`
35 --> $DIR/fn-trait-formatting.rs:19:14
36 |
37 LL | fn needs_fn<F>(x: F) where F: Fn(isize) -> isize {}
38 | ------------------ required by this bound in `needs_fn`
39 ...
40 LL | needs_fn(1);
41 | ^ expected an `Fn<(isize,)>` closure, found `{integer}`
42 |
43 = help: the trait `Fn<(isize,)>` is not implemented for `{integer}`
44
45 error: aborting due to 4 previous errors
46
47 Some errors have detailed explanations: E0277, E0308.
48 For more information about an error, try `rustc --explain E0277`.