join and select macros should use IntoFuture
conradludgate opened this issue · comments
Is your feature request related to a problem? Please describe.
A user was confused by the error messages when trying to select on an IntoFuture type.
Describe the solution you'd like
The join and select macros should call IntoFuture::into_future on setup.
Describe alternatives you've considered
Improve documentation in Rust to aid with suggesting fut.into_future()
when an IntoFuture type is poll
ed
Additional context
IntoFuture is stable since 1.64.0.
tokio/tokio/src/macros/select.rs
Line 474 in 9c337ca
tokio/tokio/src/macros/join.rs
Line 79 in 9c337ca
Shouldn't all the tokio API (tokio::spawn
, etc.) be updated to accepts IntoFuture
instead of Future
when the MRSV will be bumped?
Perhaps, but I would say that should be a separate issue from this. For the macros, this is motivated by the bad error messages, and I don't think they're as bad for tokio::spawn
.