Rollup merge of #83486 - Aaron1011:fix/global-alloc-error, r=petrochenkov
Don't ICE when using `#[global_alloc]` on a non-item statement Fixes #83469 We need to return an `Annotatable::Stmt` if we were passed an `Annotatable::Stmt`
This commit is contained in:
commit
b0bec95534
3 changed files with 35 additions and 17 deletions
|
|
@ -0,0 +1,10 @@
|
|||
// Regression test for issue #83469
|
||||
// Ensures that we recover from `#[global_alloc]` on an invalid
|
||||
// stmt without an ICE
|
||||
|
||||
fn outer() {
|
||||
#[global_allocator]
|
||||
fn inner() {} //~ ERROR allocators must be statics
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
error: allocators must be statics
|
||||
--> $DIR/issue-83469-global-alloc-invalid-stmt.rs:7:5
|
||||
|
|
||||
LL | fn inner() {}
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue