11error: the `in` operand cannot be used with `naked_asm!`
2- --> $DIR/naked-functions.rs:47 :29
2+ --> $DIR/naked-functions.rs:53 :29
33 |
44LL | naked_asm!("/* {0} */", in(reg) a)
55 | ^^ the `in` operand is not meaningful for global-scoped inline assembly, remove it
66
77error: the `in` operand cannot be used with `naked_asm!`
8- --> $DIR/naked-functions.rs:68 :10
8+ --> $DIR/naked-functions.rs:74 :10
99 |
1010LL | in(reg) a,
1111 | ^^ the `in` operand is not meaningful for global-scoped inline assembly, remove it
1212
1313error: the `noreturn` option cannot be used with `naked_asm!`
14- --> $DIR/naked-functions.rs:88 :28
14+ --> $DIR/naked-functions.rs:94 :28
1515 |
1616LL | naked_asm!("", options(noreturn));
1717 | ^^^^^^^^ the `noreturn` option is not meaningful for global-scoped inline assembly
1818
1919error: the `nomem` option cannot be used with `naked_asm!`
20- --> $DIR/naked-functions.rs:105 :28
20+ --> $DIR/naked-functions.rs:111 :28
2121 |
2222LL | naked_asm!("", options(nomem, preserves_flags));
2323 | ^^^^^ the `nomem` option is not meaningful for global-scoped inline assembly
2424
2525error: the `preserves_flags` option cannot be used with `naked_asm!`
26- --> $DIR/naked-functions.rs:105 :35
26+ --> $DIR/naked-functions.rs:111 :35
2727 |
2828LL | naked_asm!("", options(nomem, preserves_flags));
2929 | ^^^^^^^^^^^^^^^ the `preserves_flags` option is not meaningful for global-scoped inline assembly
3030
3131error: the `readonly` option cannot be used with `naked_asm!`
32- --> $DIR/naked-functions.rs:112 :28
32+ --> $DIR/naked-functions.rs:118 :28
3333 |
3434LL | naked_asm!("", options(readonly, nostack), options(pure));
3535 | ^^^^^^^^ the `readonly` option is not meaningful for global-scoped inline assembly
3636
3737error: the `nostack` option cannot be used with `naked_asm!`
38- --> $DIR/naked-functions.rs:112 :38
38+ --> $DIR/naked-functions.rs:118 :38
3939 |
4040LL | naked_asm!("", options(readonly, nostack), options(pure));
4141 | ^^^^^^^ the `nostack` option is not meaningful for global-scoped inline assembly
4242
4343error: the `pure` option cannot be used with `naked_asm!`
44- --> $DIR/naked-functions.rs:112 :56
44+ --> $DIR/naked-functions.rs:118 :56
4545 |
4646LL | naked_asm!("", options(readonly, nostack), options(pure));
4747 | ^^^^ the `pure` option is not meaningful for global-scoped inline assembly
4848
4949error: the `may_unwind` option cannot be used with `naked_asm!`
50- --> $DIR/naked-functions.rs:120 :28
50+ --> $DIR/naked-functions.rs:126 :28
5151 |
5252LL | naked_asm!("", options(may_unwind));
5353 | ^^^^^^^^^^ the `may_unwind` option is not meaningful for global-scoped inline assembly
5454
5555error: this is a user specified error
56- --> $DIR/naked-functions.rs:151 :5
56+ --> $DIR/naked-functions.rs:157 :5
5757 |
5858LL | compile_error!("this is a user specified error")
5959 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6060
6161error: this is a user specified error
62- --> $DIR/naked-functions.rs:157 :5
62+ --> $DIR/naked-functions.rs:163 :5
6363 |
6464LL | compile_error!("this is a user specified error");
6565 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6666
6767error: asm template must be a string literal
68- --> $DIR/naked-functions.rs:164 :16
68+ --> $DIR/naked-functions.rs:170 :16
6969 |
7070LL | naked_asm!(invalid_syntax)
7171 | ^^^^^^^^^^^^^^
@@ -76,40 +76,46 @@ error[E0787]: the `asm!` macro is not allowed in naked functions
7676LL | unsafe { asm!("", options(raw)) };
7777 | ^^^^^^^^^^^^^^^^^^^^^^ consider using the `naked_asm!` macro instead
7878
79+ error[E0787]: naked functions must contain a single `naked_asm!` invocation
80+ --> $DIR/naked-functions.rs:18:1
81+ |
82+ LL | pub extern "C" fn global_asm_macro() {
83+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
84+
7985error: patterns not allowed in naked function parameters
80- --> $DIR/naked-functions.rs:25 :5
86+ --> $DIR/naked-functions.rs:31 :5
8187 |
8288LL | mut a: u32,
8389 | ^^^^^
8490
8591error: patterns not allowed in naked function parameters
86- --> $DIR/naked-functions.rs:27 :5
92+ --> $DIR/naked-functions.rs:33 :5
8793 |
8894LL | &b: &i32,
8995 | ^^
9096
9197error: patterns not allowed in naked function parameters
92- --> $DIR/naked-functions.rs:29 :6
98+ --> $DIR/naked-functions.rs:35 :6
9399 |
94100LL | (None | Some(_)): Option<std::ptr::NonNull<u8>>,
95101 | ^^^^^^^^^^^^^^
96102
97103error: patterns not allowed in naked function parameters
98- --> $DIR/naked-functions.rs:31 :5
104+ --> $DIR/naked-functions.rs:37 :5
99105 |
100106LL | P { x, y }: P,
101107 | ^^^^^^^^^^
102108
103109error: referencing function parameters is not allowed in naked functions
104- --> $DIR/naked-functions.rs:40 :5
110+ --> $DIR/naked-functions.rs:46 :5
105111 |
106112LL | a + 1
107113 | ^
108114 |
109115 = help: follow the calling convention in asm block to use parameters
110116
111117error[E0787]: naked functions must contain a single `naked_asm!` invocation
112- --> $DIR/naked-functions.rs:38 :1
118+ --> $DIR/naked-functions.rs:44 :1
113119 |
114120LL | pub extern "C" fn inc(a: u32) -> u32 {
115121 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -118,7 +124,7 @@ LL | a + 1
118124 | ----- not allowed in naked functions
119125
120126error[E0787]: naked functions must contain a single `naked_asm!` invocation
121- --> $DIR/naked-functions.rs:52 :1
127+ --> $DIR/naked-functions.rs:58 :1
122128 |
123129LL | pub extern "C" fn inc_closure(a: u32) -> u32 {
124130 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -127,7 +133,7 @@ LL | (|| a + 1)()
127133 | ------------ not allowed in naked functions
128134
129135error[E0787]: naked functions must contain a single `naked_asm!` invocation
130- --> $DIR/naked-functions.rs:58 :1
136+ --> $DIR/naked-functions.rs:64 :1
131137 |
132138LL | pub extern "C" fn unsupported_operands() {
133139 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -144,13 +150,13 @@ LL | let mut e = 0usize;
144150 | ------------------- not allowed in naked functions
145151
146152error[E0787]: naked functions must contain a single `naked_asm!` invocation
147- --> $DIR/naked-functions.rs:80 :1
153+ --> $DIR/naked-functions.rs:86 :1
148154 |
149155LL | pub extern "C" fn missing_assembly() {
150156 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
151157
152158error[E0787]: naked functions must contain a single `naked_asm!` invocation
153- --> $DIR/naked-functions.rs:85 :1
159+ --> $DIR/naked-functions.rs:91 :1
154160 |
155161LL | pub extern "C" fn too_many_asm_blocks() {
156162 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -159,22 +165,22 @@ LL | naked_asm!("");
159165 | -------------- multiple `naked_asm!` invocations are not allowed in naked functions
160166
161167error: referencing function parameters is not allowed in naked functions
162- --> $DIR/naked-functions.rs:97 :11
168+ --> $DIR/naked-functions.rs:103 :11
163169 |
164170LL | *&y
165171 | ^
166172 |
167173 = help: follow the calling convention in asm block to use parameters
168174
169175error[E0787]: naked functions must contain a single `naked_asm!` invocation
170- --> $DIR/naked-functions.rs:95 :5
176+ --> $DIR/naked-functions.rs:101 :5
171177 |
172178LL | pub extern "C" fn inner(y: usize) -> usize {
173179 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
174180LL |
175181LL | *&y
176182 | --- not allowed in naked functions
177183
178- error: aborting due to 25 previous errors
184+ error: aborting due to 26 previous errors
179185
180186For more information about this error, try `rustc --explain E0787`.
0 commit comments