| error[E0308]: mismatched types |
| --> $DIR/fn-trait-formatting.rs:6:17 |
| | |
| LL | let _: () = (box |_: isize| {}) as Box<dyn FnOnce(isize)>; |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `std::boxed::Box` |
| | |
| = note: expected type `()` |
| found type `std::boxed::Box<dyn std::ops::FnOnce(isize)>` |
| |
| error[E0308]: mismatched types |
| --> $DIR/fn-trait-formatting.rs:10:17 |
| | |
| LL | let _: () = (box |_: isize, isize| {}) as Box<dyn Fn(isize, isize)>; |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `std::boxed::Box` |
| | |
| = note: expected type `()` |
| found type `std::boxed::Box<dyn std::ops::Fn(isize, isize)>` |
| |
| error[E0308]: mismatched types |
| --> $DIR/fn-trait-formatting.rs:14:17 |
| | |
| LL | let _: () = (box || -> isize { unimplemented!() }) as Box<dyn FnMut() -> isize>; |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `std::boxed::Box` |
| | |
| = note: expected type `()` |
| found type `std::boxed::Box<dyn std::ops::FnMut() -> isize>` |
| |
| error[E0277]: expected a `std::ops::Fn<(isize,)>` closure, found `{integer}` |
| --> $DIR/fn-trait-formatting.rs:19:5 |
| | |
| LL | fn needs_fn<F>(x: F) where F: Fn(isize) -> isize {} |
| | ------------------------------------------------ required by `needs_fn` |
| ... |
| LL | needs_fn(1); |
| | ^^^^^^^^ expected an `Fn<(isize,)>` closure, found `{integer}` |
| | |
| = help: the trait `std::ops::Fn<(isize,)>` is not implemented for `{integer}` |
| |
| error: aborting due to 4 previous errors |
| |
| Some errors have detailed explanations: E0277, E0308. |
| For more information about an error, try `rustc --explain E0277`. |