2024-08-04 16:43:12 +02:00
|
|
|
error: the `in` operand cannot be used with `naked_asm!`
|
2024-09-05 13:45:26 +02:00
|
|
|
--> $DIR/naked-functions.rs:47:29
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
2024-09-05 13:45:26 +02:00
|
|
|
LL | naked_asm!("/* {0} */", in(reg) a)
|
2024-08-04 16:43:12 +02:00
|
|
|
| ^^ the `in` operand is not meaningful for global-scoped inline assembly, remove it
|
|
|
|
|
|
|
|
error: the `in` operand cannot be used with `naked_asm!`
|
2024-09-05 13:45:26 +02:00
|
|
|
--> $DIR/naked-functions.rs:68:10
|
2024-08-04 16:43:12 +02:00
|
|
|
|
|
|
|
|
LL | in(reg) a,
|
|
|
|
| ^^ the `in` operand is not meaningful for global-scoped inline assembly, remove it
|
|
|
|
|
2024-09-05 13:45:26 +02:00
|
|
|
error: the `noreturn` option cannot be used with `naked_asm!`
|
2025-03-29 17:30:11 +01:00
|
|
|
--> $DIR/naked-functions.rs:88:28
|
2024-09-05 13:45:26 +02:00
|
|
|
|
|
2025-03-29 17:30:11 +01:00
|
|
|
LL | naked_asm!("", options(noreturn));
|
|
|
|
| ^^^^^^^^ the `noreturn` option is not meaningful for global-scoped inline assembly
|
2024-09-05 13:45:26 +02:00
|
|
|
|
2024-08-04 16:43:12 +02:00
|
|
|
error: the `nomem` option cannot be used with `naked_asm!`
|
2025-03-29 17:30:11 +01:00
|
|
|
--> $DIR/naked-functions.rs:105:28
|
2024-08-04 16:43:12 +02:00
|
|
|
|
|
2024-09-05 13:45:26 +02:00
|
|
|
LL | naked_asm!("", options(nomem, preserves_flags));
|
2024-08-04 16:43:12 +02:00
|
|
|
| ^^^^^ the `nomem` option is not meaningful for global-scoped inline assembly
|
|
|
|
|
|
|
|
error: the `preserves_flags` option cannot be used with `naked_asm!`
|
2025-03-29 17:30:11 +01:00
|
|
|
--> $DIR/naked-functions.rs:105:35
|
2024-08-04 16:43:12 +02:00
|
|
|
|
|
2024-09-05 13:45:26 +02:00
|
|
|
LL | naked_asm!("", options(nomem, preserves_flags));
|
2024-08-04 16:43:12 +02:00
|
|
|
| ^^^^^^^^^^^^^^^ the `preserves_flags` option is not meaningful for global-scoped inline assembly
|
|
|
|
|
|
|
|
error: the `readonly` option cannot be used with `naked_asm!`
|
2025-03-29 17:30:11 +01:00
|
|
|
--> $DIR/naked-functions.rs:112:28
|
2024-08-04 16:43:12 +02:00
|
|
|
|
|
|
|
|
LL | naked_asm!("", options(readonly, nostack), options(pure));
|
|
|
|
| ^^^^^^^^ the `readonly` option is not meaningful for global-scoped inline assembly
|
|
|
|
|
|
|
|
error: the `nostack` option cannot be used with `naked_asm!`
|
2025-03-29 17:30:11 +01:00
|
|
|
--> $DIR/naked-functions.rs:112:38
|
2024-08-04 16:43:12 +02:00
|
|
|
|
|
|
|
|
LL | naked_asm!("", options(readonly, nostack), options(pure));
|
|
|
|
| ^^^^^^^ the `nostack` option is not meaningful for global-scoped inline assembly
|
|
|
|
|
|
|
|
error: the `pure` option cannot be used with `naked_asm!`
|
2025-03-29 17:30:11 +01:00
|
|
|
--> $DIR/naked-functions.rs:112:56
|
2024-08-04 16:43:12 +02:00
|
|
|
|
|
|
|
|
LL | naked_asm!("", options(readonly, nostack), options(pure));
|
|
|
|
| ^^^^ the `pure` option is not meaningful for global-scoped inline assembly
|
|
|
|
|
|
|
|
error: the `may_unwind` option cannot be used with `naked_asm!`
|
2025-03-29 17:30:11 +01:00
|
|
|
--> $DIR/naked-functions.rs:120:28
|
2024-08-04 16:43:12 +02:00
|
|
|
|
|
2024-09-05 13:45:26 +02:00
|
|
|
LL | naked_asm!("", options(may_unwind));
|
|
|
|
| ^^^^^^^^^^ the `may_unwind` option is not meaningful for global-scoped inline assembly
|
2020-12-07 00:00:00 +00:00
|
|
|
|
2022-04-01 01:29:38 -04:00
|
|
|
error: this is a user specified error
|
2025-03-29 17:30:11 +01:00
|
|
|
--> $DIR/naked-functions.rs:151:5
|
2022-04-01 01:29:38 -04:00
|
|
|
|
|
|
|
|
LL | compile_error!("this is a user specified error")
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: this is a user specified error
|
2025-03-29 17:30:11 +01:00
|
|
|
--> $DIR/naked-functions.rs:157:5
|
2022-04-01 01:29:38 -04:00
|
|
|
|
|
|
|
|
LL | compile_error!("this is a user specified error");
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2022-04-01 12:24:04 -04:00
|
|
|
error: asm template must be a string literal
|
2025-03-29 17:30:11 +01:00
|
|
|
--> $DIR/naked-functions.rs:164:16
|
2022-04-01 12:24:04 -04:00
|
|
|
|
|
2024-08-04 16:43:12 +02:00
|
|
|
LL | naked_asm!(invalid_syntax)
|
|
|
|
| ^^^^^^^^^^^^^^
|
2022-04-01 12:24:04 -04:00
|
|
|
|
2024-09-05 13:45:26 +02:00
|
|
|
error[E0787]: the `asm!` macro is not allowed in naked functions
|
2025-03-29 17:30:11 +01:00
|
|
|
--> $DIR/naked-functions.rs:13:14
|
2024-09-05 13:45:26 +02:00
|
|
|
|
|
2025-03-29 17:30:11 +01:00
|
|
|
LL | unsafe { asm!("", options(raw)) };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ consider using the `naked_asm!` macro instead
|
2024-09-05 13:45:26 +02:00
|
|
|
|
2020-12-07 00:00:00 +00:00
|
|
|
error: patterns not allowed in naked function parameters
|
2024-09-05 13:45:26 +02:00
|
|
|
--> $DIR/naked-functions.rs:25:5
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
|
|
|
LL | mut a: u32,
|
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
error: patterns not allowed in naked function parameters
|
2024-09-05 13:45:26 +02:00
|
|
|
--> $DIR/naked-functions.rs:27:5
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
|
|
|
LL | &b: &i32,
|
|
|
|
| ^^
|
|
|
|
|
|
|
|
error: patterns not allowed in naked function parameters
|
2024-09-05 13:45:26 +02:00
|
|
|
--> $DIR/naked-functions.rs:29:6
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
|
|
|
LL | (None | Some(_)): Option<std::ptr::NonNull<u8>>,
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: patterns not allowed in naked function parameters
|
2024-09-05 13:45:26 +02:00
|
|
|
--> $DIR/naked-functions.rs:31:5
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
|
|
|
LL | P { x, y }: P,
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: referencing function parameters is not allowed in naked functions
|
2024-09-05 13:45:26 +02:00
|
|
|
--> $DIR/naked-functions.rs:40:5
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
|
|
|
LL | a + 1
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
= help: follow the calling convention in asm block to use parameters
|
|
|
|
|
2024-09-05 13:45:26 +02:00
|
|
|
error[E0787]: naked functions must contain a single `naked_asm!` invocation
|
|
|
|
--> $DIR/naked-functions.rs:38:1
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
2025-03-29 17:30:11 +01:00
|
|
|
LL | pub extern "C" fn inc(a: u32) -> u32 {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-06-25 17:45:42 +02:00
|
|
|
LL |
|
|
|
|
LL | a + 1
|
2024-09-05 13:45:26 +02:00
|
|
|
| ----- not allowed in naked functions
|
2020-12-07 00:00:00 +00:00
|
|
|
|
2024-09-05 13:45:26 +02:00
|
|
|
error[E0787]: naked functions must contain a single `naked_asm!` invocation
|
|
|
|
--> $DIR/naked-functions.rs:52:1
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
2025-03-29 17:30:11 +01:00
|
|
|
LL | pub extern "C" fn inc_closure(a: u32) -> u32 {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-06-25 17:45:42 +02:00
|
|
|
LL |
|
|
|
|
LL | (|| a + 1)()
|
2024-09-05 13:45:26 +02:00
|
|
|
| ------------ not allowed in naked functions
|
2020-12-07 00:00:00 +00:00
|
|
|
|
2024-09-05 13:45:26 +02:00
|
|
|
error[E0787]: naked functions must contain a single `naked_asm!` invocation
|
|
|
|
--> $DIR/naked-functions.rs:58:1
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
2025-03-29 17:30:11 +01:00
|
|
|
LL | pub extern "C" fn unsupported_operands() {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-06-25 17:45:42 +02:00
|
|
|
LL |
|
|
|
|
LL | let mut a = 0usize;
|
2024-09-05 13:45:26 +02:00
|
|
|
| ------------------- not allowed in naked functions
|
2022-06-25 17:45:42 +02:00
|
|
|
LL | let mut b = 0usize;
|
2024-09-05 13:45:26 +02:00
|
|
|
| ------------------- not allowed in naked functions
|
2022-06-25 17:45:42 +02:00
|
|
|
LL | let mut c = 0usize;
|
2024-09-05 13:45:26 +02:00
|
|
|
| ------------------- not allowed in naked functions
|
2022-06-25 17:45:42 +02:00
|
|
|
LL | let mut d = 0usize;
|
2024-09-05 13:45:26 +02:00
|
|
|
| ------------------- not allowed in naked functions
|
2022-06-25 17:45:42 +02:00
|
|
|
LL | let mut e = 0usize;
|
2024-09-05 13:45:26 +02:00
|
|
|
| ------------------- not allowed in naked functions
|
2020-12-07 00:00:00 +00:00
|
|
|
|
2024-09-05 13:45:26 +02:00
|
|
|
error[E0787]: naked functions must contain a single `naked_asm!` invocation
|
|
|
|
--> $DIR/naked-functions.rs:80:1
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
2022-06-25 17:45:42 +02:00
|
|
|
LL | pub extern "C" fn missing_assembly() {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-12-07 00:00:00 +00:00
|
|
|
|
2024-09-05 13:45:26 +02:00
|
|
|
error[E0787]: naked functions must contain a single `naked_asm!` invocation
|
|
|
|
--> $DIR/naked-functions.rs:85:1
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
2022-06-25 17:45:42 +02:00
|
|
|
LL | pub extern "C" fn too_many_asm_blocks() {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
...
|
2025-03-29 17:30:11 +01:00
|
|
|
LL | naked_asm!("");
|
|
|
|
| -------------- multiple `naked_asm!` invocations are not allowed in naked functions
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
|
|
error: referencing function parameters is not allowed in naked functions
|
2025-03-29 17:30:11 +01:00
|
|
|
--> $DIR/naked-functions.rs:97:11
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
|
|
|
LL | *&y
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
= help: follow the calling convention in asm block to use parameters
|
|
|
|
|
2024-09-05 13:45:26 +02:00
|
|
|
error[E0787]: naked functions must contain a single `naked_asm!` invocation
|
2025-03-29 17:30:11 +01:00
|
|
|
--> $DIR/naked-functions.rs:95:5
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
2022-06-25 17:45:42 +02:00
|
|
|
LL | pub extern "C" fn inner(y: usize) -> usize {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
LL |
|
|
|
|
LL | *&y
|
2024-09-05 13:45:26 +02:00
|
|
|
| --- not allowed in naked functions
|
2022-01-21 00:00:00 +00:00
|
|
|
|
2025-03-26 19:44:53 +01:00
|
|
|
error: aborting due to 25 previous errors
|
2020-12-07 00:00:00 +00:00
|
|
|
|
2022-01-21 00:00:00 +00:00
|
|
|
For more information about this error, try `rustc --explain E0787`.
|