Build DebugInfo for coroutine-closure
This commit is contained in:
parent
972452c447
commit
34ed554d81
4 changed files with 25 additions and 7 deletions
21
tests/codegen/async-closure-debug.rs
Normal file
21
tests/codegen/async-closure-debug.rs
Normal file
|
@ -0,0 +1,21 @@
|
|||
// Just make sure that async closures don't ICE.
|
||||
//
|
||||
// compile-flags: -C debuginfo=2 --edition=2018
|
||||
// ignore-msvc
|
||||
|
||||
// CHECK-DAG: [[GEN_FN:!.*]] = !DINamespace(name: "async_closure_test"
|
||||
// CHECK-DAG: [[CLOSURE:!.*]] = !DICompositeType(tag: DW_TAG_structure_type, name: "{closure_env#0}", scope: [[GEN_FN]]
|
||||
// CHECK-DAG: [[UPVAR:!.*]] = !DIDerivedType(tag: DW_TAG_member, name: "upvar", scope: [[CLOSURE]]
|
||||
|
||||
#![feature(async_closure)]
|
||||
|
||||
fn async_closure_test(upvar: &str) -> impl async Fn() + '_ {
|
||||
async move || {
|
||||
let hello = String::from("hello");
|
||||
println!("{hello}, {upvar}");
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let _async_closure = async_closure_test("world");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue