Skip to content

Commit 7c6d685

Browse files
Rewrite E0019 example
Inline assembly is now the only user of E0019. What is it doing that E0015 is not?
1 parent 1513904 commit 7c6d685

File tree

1 file changed

+6
-4
lines changed
  • compiler/rustc_error_codes/src/error_codes

1 file changed

+6
-4
lines changed

compiler/rustc_error_codes/src/error_codes/E0019.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ because the expression's value must be known at compile-time.
44
Erroneous code example:
55

66
```compile_fail,E0019
7-
#![feature(box_syntax)]
7+
#![feature(asm)]
88
99
fn main() {
10-
struct MyOwned;
11-
12-
static STATIC11: Box<MyOwned> = box MyOwned; // error!
10+
static STATIC11: i32 = {
11+
let x: i32;
12+
unsafe { asm!("mov rax, 2", out("rax") x) }; // error!
13+
x
14+
};
1315
}
1416
```
1517

0 commit comments

Comments
 (0)