]> git.lizzy.rs Git - rust.git/blob - src/test/ui/fn/fn-trait-formatting.stderr
Merge commit 'b7f3f7f6082679da2da9a0b3faf1b5adef3afd3b' into clippyup
[rust.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::new(|_: 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::new(|_: 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::new(|| -> 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 |     needs_fn(1);
38    |     -------- ^ expected an `Fn<(isize,)>` closure, found `{integer}`
39    |     |
40    |     required by a bound introduced by this call
41    |
42    = help: the trait `Fn<(isize,)>` is not implemented for `{integer}`
43 note: required by a bound in `needs_fn`
44   --> $DIR/fn-trait-formatting.rs:1:31
45    |
46 LL | fn needs_fn<F>(x: F) where F: Fn(isize) -> isize {}
47    |                               ^^^^^^^^^^^^^^^^^^ required by this bound in `needs_fn`
48
49 error: aborting due to 4 previous errors
50
51 Some errors have detailed explanations: E0277, E0308.
52 For more information about an error, try `rustc --explain E0277`.