1
Fork 0

Rollup merge of #95011 - michaelwoerister:awaitee_field, r=tmandry

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````
This commit is contained in:
Dylan DPC 2022-03-31 00:26:30 +02:00 committed by GitHub
commit 1c3657b20d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 40 additions and 14 deletions

View file

@ -272,6 +272,7 @@ symbols! {
__D,
__H,
__S,
__awaitee,
__try_var,
_d,
_e,
@ -1019,7 +1020,6 @@ symbols! {
pattern_parentheses,
phantom_data,
pin,
pinned,
platform_intrinsics,
plugin,
plugin_registrar,