rust/src/test/ui/fn/fn-trait-formatting.stderr

49 lines
1.9 KiB
Plaintext
Raw Normal View History

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)>;
| -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `std::boxed::Box`
| |
| expected due to this
2018-08-08 07:28:26 -05:00
|
2019-11-14 16:08:08 -06:00
= note: expected unit type `()`
found struct `std::boxed::Box<dyn std::ops::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)>;
| -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `std::boxed::Box`
| |
| expected due to this
2018-08-08 07:28:26 -05:00
|
2019-11-14 16:08:08 -06:00
= note: expected unit type `()`
found struct `std::boxed::Box<dyn std::ops::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>;
| -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `std::boxed::Box`
| |
| expected due to this
2018-08-08 07:28:26 -05:00
|
2019-11-14 16:08:08 -06:00
= note: expected unit type `()`
found struct `std::boxed::Box<dyn std::ops::FnMut() -> isize>`
2018-08-08 07:28:26 -05:00
2018-08-15 15:17:04 -05:00
error[E0277]: expected a `std::ops::Fn<(isize,)>` closure, found `{integer}`
--> $DIR/fn-trait-formatting.rs:19:14
2018-08-08 07:28:26 -05:00
|
LL | fn needs_fn<F>(x: F) where F: Fn(isize) -> isize {}
| -------- ------------------ required by this bound in `needs_fn`
...
2018-08-08 07:28:26 -05:00
LL | needs_fn(1);
| ^ expected an `Fn<(isize,)>` closure, found `{integer}`
2018-08-08 07:28:26 -05:00
|
2018-08-15 15:17:04 -05:00
= help: the trait `std::ops::Fn<(isize,)>` is not implemented for `{integer}`
2018-08-08 07:28:26 -05:00
error: aborting due to 4 previous errors
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`.