File tree Expand file tree Collapse file tree 5 files changed +67
-3
lines changed Expand file tree Collapse file tree 5 files changed +67
-3
lines changed Original file line number Diff line number Diff line change 1- // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
1+ // Copyright 2018 The Rust Project Developers. See the COPYRIGHT
22// file at the top-level directory of this distribution and at
33// http://rust-lang.org/COPYRIGHT.
44//
1515// In vim you can `:set tw=80` and use `gq` to wrap paragraphs. Use `:set tw=0` to disable.
1616register_long_diagnostics ! {
1717E0660 : r##"
18+ The argument to the `asm` macro is not well-formed.
19+
20+ Erroneous code example:
21+
22+ ```compile_fail,E0660
23+ asm!("nop" "nop");
24+ ```
25+
26+ Considering that this would be a long explanation, we instead recommend you to
27+ take a look at the unstable book:
28+ https://doc.rust-lang.org/unstable-book/language-features/asm.html
1829"## ,
1930
2031E0661 : r##"
32+ An invalid syntax was passed to the second argument of an `asm` macro line.
33+
34+ Erroneous code example:
35+
36+ ```compile_fail,E0661
37+ let a;
38+ asm!("nop" : "r"(a));
39+ ```
40+
41+ Considering that this would be a long explanation, we instead recommend you to
42+ take a look at the unstable book:
43+ https://doc.rust-lang.org/unstable-book/language-features/asm.html
2144"## ,
2245}
Original file line number Diff line number Diff line change 77// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
88// option. This file may not be copied, modified, or distributed
99// except according to those terms.
10+
1011#![ feature( asm) ]
1112
1213fn main ( ) {
1314 let a;
14- asm ! ( "nop" "nop" ) ; //~ ERROR malformed inline assembly
15- asm ! ( "nop" "nop" : "=r" ( a) ) ; //~ ERROR malformed inline assembly
15+ asm ! ( "nop" "nop" ) ;
16+ asm ! ( "nop" "nop" : "=r" ( a) ) ;
1617}
Original file line number Diff line number Diff line change 1+ error[E0660]: malformed inline assembly
2+ --> $DIR/E0660.rs:15:5
3+ |
4+ LL | asm!("nop" "nop");
5+ | ^^^^^^^^^^^^^^^^^^
6+
7+ error[E0660]: malformed inline assembly
8+ --> $DIR/E0660.rs:16:5
9+ |
10+ LL | asm!("nop" "nop" : "=r"(a));
11+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12+
13+ error: aborting due to 2 previous errors
14+
15+ For more information about this error, try `rustc --explain E0660`.
Original file line number Diff line number Diff line change 1+ // Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2+ // file at the top-level directory of this distribution and at
3+ // http://rust-lang.org/COPYRIGHT.
4+ //
5+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+ // option. This file may not be copied, modified, or distributed
9+ // except according to those terms.
10+
11+ #![ feature( asm) ]
12+
13+ fn main ( ) {
14+ let a;
15+ asm ! ( "nop" : "r" ( a) ) ;
16+ }
Original file line number Diff line number Diff line change 1+ error[E0661]: output operand constraint lacks '=' or '+'
2+ --> $DIR/E0661.rs:15:18
3+ |
4+ LL | asm!("nop" : "r"(a));
5+ | ^^^
6+
7+ error: aborting due to previous error
8+
9+ For more information about this error, try `rustc --explain E0661`.
You can’t perform that action at this time.
0 commit comments