|
1 |
| -error[E0593]: closure is expected to take 1 argument, but it takes 0 arguments |
2 |
| - --> $DIR/fnbox-compat.rs:11:34 |
| 1 | +error: implementation of `std::ops::FnOnce` is not general enough |
| 2 | + --> $DIR/fnbox-compat.rs:6:5 |
3 | 3 | |
|
4 |
| -LL | assert_eq!(&call_it(Box::new(|| s)) as &str, "hello"); |
5 |
| - | ^^ |
6 |
| - | | |
7 |
| - | expected closure that takes 1 argument |
8 |
| - | takes 0 arguments |
9 |
| -help: consider changing the closure to take and ignore the expected argument |
| 4 | +LL | f(&42) |
| 5 | + | ^^^^^^ |
10 | 6 | |
|
11 |
| -LL | assert_eq!(&call_it(Box::new(|_| s)) as &str, "hello"); |
12 |
| - | ^^^ |
| 7 | + = note: `std::ops::FnOnce<(&'0 i32,)>` would have to be implemented for the type `std::boxed::Box<(dyn for<'r> std::boxed::FnBox<(&'r i32,), Output=T> + 'static)>`, for some specific lifetime `'0` |
| 8 | + = note: but `std::ops::FnOnce<(&'1 i32,)>` is actually implemented for the type `std::boxed::Box<(dyn std::boxed::FnBox<(&'1 i32,), Output=T> + '_)>`, for some specific lifetime `'1` |
13 | 9 |
|
14 |
| -error[E0277]: the size for values of type `dyn for<'r> std::boxed::FnBox<(&'r i32,), Output=_>` cannot be known at compilation time |
15 |
| - --> $DIR/fnbox-compat.rs:11:25 |
16 |
| - | |
17 |
| -LL | assert_eq!(&call_it(Box::new(|| s)) as &str, "hello"); |
18 |
| - | ^^^^^^^^ doesn't have a size known at compile-time |
19 |
| - | |
20 |
| - = help: the trait `std::marker::Sized` is not implemented for `dyn for<'r> std::boxed::FnBox<(&'r i32,), Output=_>` |
21 |
| - = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait> |
22 |
| - = note: required by `<std::boxed::Box<T>>::new` |
23 |
| - |
24 |
| -error: aborting due to 2 previous errors |
| 10 | +error: aborting due to previous error |
25 | 11 |
|
26 |
| -Some errors occurred: E0277, E0593. |
27 |
| -For more information about an error, try `rustc --explain E0277`. |
0 commit comments