Bless tests

This commit is contained in:
Gary Guo 2021-09-16 23:04:02 +01:00
parent 19eaee2c32
commit ab64580977
10 changed files with 352 additions and 223 deletions

View file

@ -9,5 +9,5 @@ fn main() {}
static TEST_BAD: &mut i32 = {
&mut *(box 0)
//~^ ERROR could not evaluate static initializer
//~| NOTE heap allocations
//~| NOTE calling non-const function `alloc::alloc::exchange_malloc`
};

View file

@ -2,7 +2,7 @@ error[E0080]: could not evaluate static initializer
--> $DIR/box.rs:10:11
|
LL | &mut *(box 0)
| ^^^^^^^ "heap allocations via `box` keyword" needs an rfc before being allowed inside constants
| ^^^^^^^ calling non-const function `alloc::alloc::exchange_malloc`
warning: skipping const checks
|

View file

@ -4,7 +4,7 @@ error[E0597]: `tmp0` does not live long enough
LL | let tmp1 = &tmp0;
| ^^^^^ borrowed value does not live long enough
LL | box tmp1 as Box<dyn Foo + '_>
| ----------------------------- borrow later captured here by trait object
| ----------------------------- borrow later used here
LL | };
| - `tmp0` dropped here while still borrowed