This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ // This test verifies the accuracy of emitted file and line debuginfo metadata for async blocks and
2+ // async functions.
3+ //
4+ // edition: 2021
5+ // compile-flags: -C debuginfo=2
6+ #![ crate_type = "lib" ]
7+
8+ // ignore-tidy-linelength
9+
10+ // NONMSVC-DAG: ![[#FILE:]] = !DIFile({{.*}}filename:{{.*}}/codegen/issue-98678-async.rs{{".*}})
11+ // MSVC: ![[#FILE:]] = !DIFile({{.*}}filename:{{.*}}\\codegen\\issue-98678-async.rs{{".*}})
12+
13+ // NONMSVC-DAG: !DISubprogram(name: "foo",{{.*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 2]],
14+ // MSVC-DAG: !DISubprogram(name: "foo",{{.*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 1]],
15+ pub async fn foo ( ) -> u8 { 5 }
16+
17+ pub fn bar ( ) -> impl std:: future:: Future < Output = u8 > {
18+ // NONMSVC: !DICompositeType({{.*"}}{async_block_env#0}{{".*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 2]],
19+ // MSVC-DAG: !DICompositeType({{.*"}}enum2$<issue_98678_async::bar::async_block_env$0>{{".*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 1]],
20+ async {
21+ let x: u8 = foo ( ) . await ;
22+ x + 5
23+ }
24+
25+ }
You can’t perform that action at this time.
0 commit comments