Skip to content

Commit b48def8

Browse files
Regression test for case in #77361
1 parent 50e0c0d commit b48def8

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/test/ui/consts/async-block.rs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// From <https://github.com/rust-lang/rust/issues/77361>
2+
3+
// edition:2018
4+
5+
const _: i32 = { core::mem::ManuallyDrop::new(async { 0 }); 4 };
6+
//~^ `async` block
7+
8+
fn main() {}

src/test/ui/consts/async-block.stderr

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: `async` blocks are not allowed in constants
2+
--> $DIR/async-block.rs:5:47
3+
|
4+
LL | const _: i32 = { core::mem::ManuallyDrop::new(async { 0 }); 4 };
5+
| ^^^^^^^^^^^
6+
7+
error: aborting due to previous error
8+

0 commit comments

Comments
 (0)