-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
async: Give predictable name to binding generated from .await expressions. #95011
Conversation
I'm wondering if it's possible to make the name something not writeable by the user like @bors r+ |
📌 Commit daa47488a7e2eff1bece9e3e26eb2eaa72f70126 has been approved by |
⌛ Testing commit daa47488a7e2eff1bece9e3e26eb2eaa72f70126 with merge 636998919c20fa752c1842488c057cdd94e3a5c4... |
💔 Test failed - checks-actions |
This comment has been minimized.
This comment has been minimized.
daa4748
to
016ad35
Compare
…it expressions. This name makes it to debuginfo and allows debuggers to identify such bindings and their captured versions in suspended async fns.
016ad35
to
78e27e2
Compare
Yeah, I've been wondering about that too. But I think it's better to stick to something that's a valid identifier in most contexts. The leading double underscore is a pretty strong convention for reserved names (at least in the C world). |
Fixed the test case so it works on MSVC too. |
📌 Commit 78e27e2 has been approved by |
…mandry async: Give predictable name to binding generated from .await expressions. This name makes it to debuginfo and allows debuggers to identify such bindings and their captured versions in suspended async fns. This will be useful for async stack traces, as discussed in https://internals.rust-lang.org/t/async-debugging-logical-stack-traces-setting-goals-collecting-examples/15547. I don't know if this needs some discussion by `@rust-lang/compiler,` e.g. about the name of the binding (`__awaitee`) or about the fact that this PR introduces a (soft) guarantee about a compiler generated name. Although, regarding the later, I think the same reasoning applies here as it does for debuginfo in general. r? `@tmandry`
…mandry async: Give predictable name to binding generated from .await expressions. This name makes it to debuginfo and allows debuggers to identify such bindings and their captured versions in suspended async fns. This will be useful for async stack traces, as discussed in https://internals.rust-lang.org/t/async-debugging-logical-stack-traces-setting-goals-collecting-examples/15547. I don't know if this needs some discussion by ``@rust-lang/compiler,`` e.g. about the name of the binding (`__awaitee`) or about the fact that this PR introduces a (soft) guarantee about a compiler generated name. Although, regarding the later, I think the same reasoning applies here as it does for debuginfo in general. r? ``@tmandry``
…mandry async: Give predictable name to binding generated from .await expressions. This name makes it to debuginfo and allows debuggers to identify such bindings and their captured versions in suspended async fns. This will be useful for async stack traces, as discussed in https://internals.rust-lang.org/t/async-debugging-logical-stack-traces-setting-goals-collecting-examples/15547. I don't know if this needs some discussion by ```@rust-lang/compiler,``` e.g. about the name of the binding (`__awaitee`) or about the fact that this PR introduces a (soft) guarantee about a compiler generated name. Although, regarding the later, I think the same reasoning applies here as it does for debuginfo in general. r? ```@tmandry```
Rollup of 6 pull requests Successful merges: - rust-lang#93901 (Stabilize native library modifier syntax and the `whole-archive` modifier specifically) - rust-lang#94806 (Fix `cargo run tidy`) - rust-lang#94869 (Add the generic_associated_types_extended feature) - rust-lang#95011 (async: Give predictable name to binding generated from .await expressions.) - rust-lang#95251 (Reduce max hash in raw strings from u16 to u8) - rust-lang#95298 (Fix double drop of allocator in IntoIter impl of Vec) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 6 pull requests Successful merges: - rust-lang#93901 (Stabilize native library modifier syntax and the `whole-archive` modifier specifically) - rust-lang#94806 (Fix `cargo run tidy`) - rust-lang#94869 (Add the generic_associated_types_extended feature) - rust-lang#95011 (async: Give predictable name to binding generated from .await expressions.) - rust-lang#95251 (Reduce max hash in raw strings from u16 to u8) - rust-lang#95298 (Fix double drop of allocator in IntoIter impl of Vec) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This name makes it to debuginfo and allows debuggers to identify such bindings and their captured versions in suspended async fns.
This will be useful for async stack traces, as discussed in https://internals.rust-lang.org/t/async-debugging-logical-stack-traces-setting-goals-collecting-examples/15547.
I don't know if this needs some discussion by @rust-lang/compiler, e.g. about the name of the binding (
__awaitee
) or about the fact that this PR introduces a (soft) guarantee about a compiler generated name. Although, regarding the later, I think the same reasoning applies here as it does for debuginfo in general.r? @tmandry