about summary refs log tree commit diff
path: root/src/test/codegen
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-03-31 00:29:54 +0000
committerbors <bors@rust-lang.org>2022-03-31 00:29:54 +0000
commita39ac5ae175e0f9f910b1800a430b488ec0f2105 (patch)
tree1901e59455c2d055cf2d8642fccde25040ca35fb /src/test/codegen
parenta40c595695bff3bfb373a8a3355ae4bd4ea64608 (diff)
parentd6c959c680df8e3a68932e42ed919f5664669cc7 (diff)
downloadrust-a39ac5ae175e0f9f910b1800a430b488ec0f2105.tar.gz
rust-a39ac5ae175e0f9f910b1800a430b488ec0f2105.zip
Auto merge of #95501 - Dylan-DPC:rollup-arx6sdc, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #93901 (Stabilize native library modifier syntax and the `whole-archive` modifier specifically)
 - #94806 (Fix `cargo run tidy`)
 - #94869 (Add the generic_associated_types_extended feature)
 - #95011 (async: Give predictable name to binding generated from .await expressions.)
 - #95251 (Reduce max hash in raw strings from u16 to u8)
 - #95298 (Fix double drop of allocator in IntoIter impl of Vec)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src/test/codegen')
-rw-r--r--src/test/codegen/async-fn-debug-awaitee-field.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/codegen/async-fn-debug-awaitee-field.rs b/src/test/codegen/async-fn-debug-awaitee-field.rs
new file mode 100644
index 00000000000..efb345fa9f3
--- /dev/null
+++ b/src/test/codegen/async-fn-debug-awaitee-field.rs
@@ -0,0 +1,23 @@
+// This test makes sure that the generator field capturing the awaitee in a `.await` expression
+// is called "__awaitee" in debuginfo. This name must not be changed since debuggers and debugger
+// extensions rely on the field having this name.
+
+// ignore-tidy-linelength
+// compile-flags: -C debuginfo=2 --edition=2018
+
+async fn foo() {}
+
+async fn async_fn_test() {
+    foo().await;
+}
+
+// NONMSVC: [[GEN:!.*]] = !DICompositeType(tag: DW_TAG_structure_type, name: "{async_fn_env#0}",
+// MSVC: [[GEN:!.*]] = !DICompositeType(tag: DW_TAG_union_type, name: "enum$<async_fn_debug_awaitee_field::async_fn_test::async_fn_env$0>",
+// CHECK: [[SUSPEND_STRUCT:!.*]] = !DICompositeType(tag: DW_TAG_structure_type, name: "Suspend0", scope: [[GEN]],
+// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "__awaitee", scope: [[SUSPEND_STRUCT]], {{.*}}, baseType: [[AWAITEE_TYPE:![0-9]*]],
+// NONMSVC: [[AWAITEE_TYPE]] = !DICompositeType(tag: DW_TAG_structure_type, name: "GenFuture<async_fn_debug_awaitee_field::foo::{async_fn_env#0}>",
+// MSVC: [[AWAITEE_TYPE]] = !DICompositeType(tag: DW_TAG_structure_type, name: "GenFuture<enum$<async_fn_debug_awaitee_field::foo::async_fn_env$0> >",
+
+fn main() {
+    let _fn = async_fn_test();
+}