mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
Regression test for case in #77361
This commit is contained in:
parent
50e0c0d97b
commit
b48def819e
8
src/test/ui/consts/async-block.rs
Normal file
8
src/test/ui/consts/async-block.rs
Normal file
@ -0,0 +1,8 @@
|
||||
// From <https://github.com/rust-lang/rust/issues/77361>
|
||||
|
||||
// edition:2018
|
||||
|
||||
const _: i32 = { core::mem::ManuallyDrop::new(async { 0 }); 4 };
|
||||
//~^ `async` block
|
||||
|
||||
fn main() {}
|
8
src/test/ui/consts/async-block.stderr
Normal file
8
src/test/ui/consts/async-block.stderr
Normal file
@ -0,0 +1,8 @@
|
||||
error: `async` blocks are not allowed in constants
|
||||
--> $DIR/async-block.rs:5:47
|
||||
|
|
||||
LL | const _: i32 = { core::mem::ManuallyDrop::new(async { 0 }); 4 };
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
Loading…
Reference in New Issue
Block a user