-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Do not include implicit desugared closure from async fn
in closure type path
#144372
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
Do not include implicit desugared closure from async fn
in closure type path
#144372
Conversation
This comment has been minimized.
This comment has been minimized.
add3f90
to
b89376f
Compare
r? @davidtwco rustbot has assigned @davidtwco. Use |
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.
I think this change is detrimental to understanding the actual structure of the desugared program. The reality here is that there are two items, async_function
and async_function::{closure#0}
. We really should keep distinguishing them.
Especially because the only changes are in mir-opt outputs and rustc_force_inline
, which is currently a non-stable feature -- my understanding is that we could improve the diagnostics for that by improving the messaging in that case.
If you are dissatisfied with the output of @rustbot author |
Reminder, once the PR becomes ready for a review, use |
So this means we'll have two |
The job Click to see the possible cause of the failure (guessed by this bot)
|
Make the path of items within an
async fn
, including the implicitasync
closure it desugars to not include the{closure#0}
path segment. Soasync fn
foo::{closure#0}
gets rendered asfoo
instead in diagnostics. This only affects the pprinter used for diagnostics, the implicit closure is still included in symbol mangling. End users should not need to be exposed to the inner workings of async desugaring in normal circumstances.Noticed while looking at #144337 / https://internals.rust-lang.org/t/post-0/23184 to modify the closure rendering without paths. Changing the test runner to use
-Zspan_free_formats
showed many cases where the previous rendering for async functions was quite confusing, particularly for those that had closures within them.