File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -209,3 +209,9 @@ pub unsafe extern "C" fn allow_compile_error_and_asm(a: u32) -> u32 {
209209 //~^ ERROR this is a user specified error
210210 asm ! ( "" , options( noreturn) )
211211}
212+
213+ #[ naked]
214+ pub unsafe extern "C" fn invalid_asm_syntax ( a : u32 ) -> u32 {
215+ asm ! ( invalid_syntax)
216+ //~^ ERROR asm template must be a string literal
217+ }
Original file line number Diff line number Diff line change @@ -16,6 +16,12 @@ error: this is a user specified error
1616LL | compile_error!("this is a user specified error");
1717 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1818
19+ error: asm template must be a string literal
20+ --> $DIR/naked-functions.rs:215:10
21+ |
22+ LL | asm!(invalid_syntax)
23+ | ^^^^^^^^^^^^^^
24+
1925error: patterns not allowed in naked function parameters
2026 --> $DIR/naked-functions.rs:20:5
2127 |
@@ -267,6 +273,6 @@ error: naked functions cannot be inlined
267273LL | #[inline(never)]
268274 | ^^^^^^^^^^^^^^^^
269275
270- error: aborting due to 32 previous errors; 2 warnings emitted
276+ error: aborting due to 33 previous errors; 2 warnings emitted
271277
272278For more information about this error, try `rustc --explain E0787`.
You can’t perform that action at this time.
0 commit comments