Rewrite E0019 example
Inline assembly is now the only user of E0019. What is it doing that E0015 is not?
This commit is contained in:
parent
1513904c1c
commit
7c6d685551
1 changed files with 6 additions and 4 deletions
|
@ -4,12 +4,14 @@ because the expression's value must be known at compile-time.
|
||||||
Erroneous code example:
|
Erroneous code example:
|
||||||
|
|
||||||
```compile_fail,E0019
|
```compile_fail,E0019
|
||||||
#![feature(box_syntax)]
|
#![feature(asm)]
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
struct MyOwned;
|
static STATIC11: i32 = {
|
||||||
|
let x: i32;
|
||||||
static STATIC11: Box<MyOwned> = box MyOwned; // error!
|
unsafe { asm!("mov rax, 2", out("rax") x) }; // error!
|
||||||
|
x
|
||||||
|
};
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue