mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-20 02:43:45 +00:00
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
@ -4,12 +4,14 @@ because the expression's value must be known at compile-time.
|
||||
Erroneous code example:
|
||||
|
||||
```compile_fail,E0019
|
||||
#![feature(box_syntax)]
|
||||
#![feature(asm)]
|
||||
|
||||
fn main() {
|
||||
struct MyOwned;
|
||||
|
||||
static STATIC11: Box<MyOwned> = box MyOwned; // error!
|
||||
static STATIC11: i32 = {
|
||||
let x: i32;
|
||||
unsafe { asm!("mov rax, 2", out("rax") x) }; // error!
|
||||
x
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user