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

Relax CallOnceFuture/CallRefFuture bound from Future to IntoFuture #127225

Closed

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Jul 1, 2024

Implements the change suggested in rust-lang/rfcs#3668 (comment). Blocked on some relevant team deciding whether to use IntoFuture or Future for AsyncFnOnce bounds.

This also adds IntoFuture and IntoFuture::Output as lang items, so they can be referenced in those trait bounds.

Notable: the concrete future returned by calling a concrete async closure still implements Future and IntoFuture. This just makes the trait definition more generic, so the caller can pass more kinds of closures in.

r? oli-obk

Tracking:

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 1, 2024
@rustbot
Copy link
Collaborator

rustbot commented Jul 1, 2024

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@rustbot rustbot added T-libs Relevant to the library team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Jul 1, 2024
@@ -130,7 +132,8 @@ pub trait IntoFuture {
/// # }
/// ```
#[stable(feature = "into_future", since = "1.64.0")]
#[lang = "into_future"]
#[cfg_attr(not(bootstrap), lang = "into_future_into_future")]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed the existing lang item to into_future_into_future, and reused that name for the trait name for consistency!

@traviscross traviscross added the F-async_closure `#![feature(async_closure)]` label Jul 1, 2024
@rust-log-analyzer

This comment has been minimized.

@compiler-errors compiler-errors added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 1, 2024
@compiler-errors
Copy link
Member Author

only opened this for demo, will reopen if needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-async_closure `#![feature(async_closure)]` S-blocked Status: Blocked on something else such as an RFC or other implementation work. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants