Closed
Description
With 0.1.x and 0.2.x it was possible to return Box<Future<Item = ..., Error = ...>>
, but with the 0.3 branch it's no longer possible.
trait T {
fn f() -> Box<Future<Output = ()>>;
}
This code gives the following compile error:
error[E0038]: the trait `std::future::Future` cannot be made into an object
--> src/main.rs:4:5
|
4 | fn f() -> Box<Future<Output = ()>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::future::Future` cannot be made into an object
|
= note: method `poll` has a non-standard `self` type
Returning with impl Trait
is not allowed in trait functions, so that method does not work on any branch.
Metadata
Metadata
Assignees
Labels
No labels