-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Introduce support for async
bound modifier on Fn*
traits
#120392
Conversation
r? @davidtwco (rustbot has picked a reviewer for you, use r? to override) |
@rustbot label: I-lang-nominated Hi @rust-lang/lang. Does this warrant a new experiment, or can I consider it to be part of the existing lang team experiment for |
Oh, also cc @rust-lang/wg-async as well. |
This comment has been minimized.
This comment has been minimized.
aefa8d7
to
792e3b5
Compare
This comment has been minimized.
This comment has been minimized.
792e3b5
to
d2bb2cc
Compare
Changes to the size of AST and/or HIR nodes. cc @nnethercote |
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (cb0d84e): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 660.662s -> 659.815s (-0.13%) |
Perf effect seems unremarkable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation looks good, r=me after relevant approvals, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rustc_ast_pretty
still needs to be updated to accommodate the addition.
d2bb2cc
to
7abcf33
Compare
7abcf33
to
3913c9a
Compare
T-lang went over this in a meeting today saying there is no concern here. I'm gonna approve this as gated under the @rustbot label: -I-lang-nominated |
@bors r=davidtwco,fmease |
☀️ Test successful - checks-actions |
Finished benchmarking commit (f3b9d47): comparison URL. Overall result: ❌ regressions - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 661.246s -> 662.71s (0.22%) |
Adds
async
to the list ofTraitBoundModifiers
, which instructs AST lowering to map the trait to an async flavor of the trait. For now, this is only supported forFn*
toAsyncFn*
, and I expect that this manual mapping via lang items will be replaced with a better system in the future.The motivation for adding these bounds is to separate the users of async closures from the exact trait desugaring of their callable bounds. Instead of users needing to be concerned with the
AsyncFn
trait, they should be able to writeasync Fn()
and it will desugar to whatever underlying trait we decide is best for the lowering of async closures.Note: rustfmt support can be done in the rustfmt repo after a subtree sync.