Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

join and select macros should use IntoFuture #6442

Open
conradludgate opened this issue Mar 29, 2024 · 2 comments
Open

join and select macros should use IntoFuture #6442

conradludgate opened this issue Mar 29, 2024 · 2 comments
Labels
A-tokio Area: The main tokio crate C-feature-request Category: A feature request. M-macros Module: macros in the main Tokio crate S-blocked-on-msrv Status: need an MSRV bump to progress

Comments

@conradludgate
Copy link
Contributor

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 polled

Additional context
IntoFuture is stable since 1.64.0.

let mut futures = ( $( $fut , )+ );

let mut futures = ( $( maybe_done($e), )* );

@conradludgate conradludgate added A-tokio Area: The main tokio crate C-feature-request Category: A feature request. labels Mar 29, 2024
@Darksonn Darksonn added M-macros Module: macros in the main Tokio crate S-blocked-on-msrv Status: need an MSRV bump to progress labels Mar 29, 2024
@wyfo
Copy link

wyfo commented Apr 26, 2024

Shouldn't all the tokio API (tokio::spawn, etc.) be updated to accepts IntoFuture instead of Future when the MRSV will be bumped?

@Darksonn
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate C-feature-request Category: A feature request. M-macros Module: macros in the main Tokio crate S-blocked-on-msrv Status: need an MSRV bump to progress
Projects
None yet
Development

No branches or pull requests

3 participants