diff options
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/consts/async-block.rs | 8 | ||||
| -rw-r--r-- | src/test/ui/consts/async-block.stderr | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/test/ui/consts/async-block.rs b/src/test/ui/consts/async-block.rs new file mode 100644 index 00000000000..1fa2a616091 --- /dev/null +++ b/src/test/ui/consts/async-block.rs @@ -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() {} diff --git a/src/test/ui/consts/async-block.stderr b/src/test/ui/consts/async-block.stderr new file mode 100644 index 00000000000..99f470623ac --- /dev/null +++ b/src/test/ui/consts/async-block.stderr @@ -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 + |
