Rollup merge of #77415 - ecstatic-morse:const-checking-async-block, r=oli-obk
Better error message for `async` blocks in a const-context Improves the error message for the case in #77361. r? @oli-obk
This commit is contained in:
commit
cac5352e33
4 changed files with 28 additions and 3 deletions
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…
Add table
Add a link
Reference in a new issue