2018-08-08 07:28:26 -05:00
|
|
|
error[E0308]: mismatched types
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/fn-trait-formatting.rs:6:17
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
2019-05-28 13:46:13 -05:00
|
|
|
LL | let _: () = (box |_: isize| {}) as Box<dyn FnOnce(isize)>;
|
2020-09-02 02:40:56 -05:00
|
|
|
| -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `Box`
|
2019-11-18 23:00:24 -06:00
|
|
|
| |
|
|
|
|
| expected due to this
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
2019-11-14 16:08:08 -06:00
|
|
|
= note: expected unit type `()`
|
2020-09-02 02:40:56 -05:00
|
|
|
found struct `Box<dyn FnOnce(isize)>`
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/fn-trait-formatting.rs:10:17
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
2019-05-28 13:46:13 -05:00
|
|
|
LL | let _: () = (box |_: isize, isize| {}) as Box<dyn Fn(isize, isize)>;
|
2020-09-02 02:40:56 -05:00
|
|
|
| -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `Box`
|
2019-11-18 23:00:24 -06:00
|
|
|
| |
|
|
|
|
| expected due to this
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
2019-11-14 16:08:08 -06:00
|
|
|
= note: expected unit type `()`
|
2020-09-02 02:40:56 -05:00
|
|
|
found struct `Box<dyn Fn(isize, isize)>`
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/fn-trait-formatting.rs:14:17
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
2019-05-28 13:46:13 -05:00
|
|
|
LL | let _: () = (box || -> isize { unimplemented!() }) as Box<dyn FnMut() -> isize>;
|
2020-09-02 02:40:56 -05:00
|
|
|
| -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `Box`
|
2019-11-18 23:00:24 -06:00
|
|
|
| |
|
|
|
|
| expected due to this
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
2019-11-14 16:08:08 -06:00
|
|
|
= note: expected unit type `()`
|
2020-09-02 02:40:56 -05:00
|
|
|
found struct `Box<dyn FnMut() -> isize>`
|
2018-08-08 07:28:26 -05:00
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
error[E0277]: expected a `Fn<(isize,)>` closure, found `{integer}`
|
2019-09-15 23:58:20 -05:00
|
|
|
--> $DIR/fn-trait-formatting.rs:19:14
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
2019-08-24 16:44:43 -05:00
|
|
|
LL | fn needs_fn<F>(x: F) where F: Fn(isize) -> isize {}
|
2020-04-06 00:15:06 -05:00
|
|
|
| ------------------ required by this bound in `needs_fn`
|
2019-08-24 16:44:43 -05:00
|
|
|
...
|
2018-08-08 07:28:26 -05:00
|
|
|
LL | needs_fn(1);
|
2019-09-15 23:58:20 -05:00
|
|
|
| ^ expected an `Fn<(isize,)>` closure, found `{integer}`
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
= help: the trait `Fn<(isize,)>` is not implemented for `{integer}`
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
error: aborting due to 4 previous errors
|
|
|
|
|
2019-04-17 12:26:38 -05:00
|
|
|
Some errors have detailed explanations: E0277, E0308.
|
2018-08-08 07:28:26 -05:00
|
|
|
For more information about an error, try `rustc --explain E0277`.
|