Bless tests
This commit is contained in:
parent
19eaee2c32
commit
ab64580977
10 changed files with 352 additions and 223 deletions
|
|
@ -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`
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue