2021-07-29 04:15:50 -05:00
|
|
|
error: asm with the `pure` option must have at least one output
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:112:14
|
2020-12-06 18:00:00 -06:00
|
|
|
|
|
|
|
|
LL | asm!("", options(readonly, nostack), options(pure));
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^
|
|
|
|
|
2022-04-01 00:29:38 -05:00
|
|
|
error: this is a user specified error
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:204:5
|
2022-04-01 00:29:38 -05:00
|
|
|
|
|
|
|
|
LL | compile_error!("this is a user specified error")
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: this is a user specified error
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:210:5
|
2022-04-01 00:29:38 -05:00
|
|
|
|
|
|
|
|
LL | compile_error!("this is a user specified error");
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2022-04-01 11:24:04 -05:00
|
|
|
error: asm template must be a string literal
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:217:10
|
2022-04-01 11:24:04 -05:00
|
|
|
|
|
|
|
|
LL | asm!(invalid_syntax)
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
2020-12-06 18:00:00 -06:00
|
|
|
error: patterns not allowed in naked function parameters
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:19:5
|
2020-12-06 18:00:00 -06:00
|
|
|
|
|
|
|
|
LL | mut a: u32,
|
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
error: patterns not allowed in naked function parameters
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:21:5
|
2020-12-06 18:00:00 -06:00
|
|
|
|
|
|
|
|
LL | &b: &i32,
|
|
|
|
| ^^
|
|
|
|
|
|
|
|
error: patterns not allowed in naked function parameters
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:23:6
|
2020-12-06 18:00:00 -06:00
|
|
|
|
|
|
|
|
LL | (None | Some(_)): Option<std::ptr::NonNull<u8>>,
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: patterns not allowed in naked function parameters
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:25:5
|
2020-12-06 18:00:00 -06:00
|
|
|
|
|
|
|
|
LL | P { x, y }: P,
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: referencing function parameters is not allowed in naked functions
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:34:5
|
2020-12-06 18:00:00 -06:00
|
|
|
|
|
|
|
|
LL | a + 1
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
= help: follow the calling convention in asm block to use parameters
|
|
|
|
|
2022-01-20 18:00:00 -06:00
|
|
|
error[E0787]: naked functions must contain a single asm block
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:32:1
|
2020-12-06 18:00:00 -06:00
|
|
|
|
|
2022-06-25 10:45:42 -05:00
|
|
|
LL | pub unsafe extern "C" fn inc(a: u32) -> u32 {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
LL |
|
|
|
|
LL | a + 1
|
|
|
|
| ----- non-asm is unsupported in naked functions
|
2020-12-06 18:00:00 -06:00
|
|
|
|
|
|
|
error: referencing function parameters is not allowed in naked functions
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:41:31
|
2020-12-06 18:00:00 -06:00
|
|
|
|
|
|
|
|
LL | asm!("/* {0} */", in(reg) a, options(noreturn));
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
= help: follow the calling convention in asm block to use parameters
|
|
|
|
|
2022-01-20 18:00:00 -06:00
|
|
|
error[E0787]: only `const` and `sym` operands are supported in naked functions
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:41:23
|
2020-12-06 18:00:00 -06:00
|
|
|
|
|
|
|
|
LL | asm!("/* {0} */", in(reg) a, options(noreturn));
|
|
|
|
| ^^^^^^^^^
|
|
|
|
|
2022-01-20 18:00:00 -06:00
|
|
|
error[E0787]: naked functions must contain a single asm block
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:47:1
|
2020-12-06 18:00:00 -06:00
|
|
|
|
|
2022-06-25 10:45:42 -05:00
|
|
|
LL | pub unsafe extern "C" fn inc_closure(a: u32) -> u32 {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
LL |
|
|
|
|
LL | (|| a + 1)()
|
|
|
|
| ------------ non-asm is unsupported in naked functions
|
2020-12-06 18:00:00 -06:00
|
|
|
|
2022-01-20 18:00:00 -06:00
|
|
|
error[E0787]: only `const` and `sym` operands are supported in naked functions
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:64:10
|
2020-12-06 18:00:00 -06:00
|
|
|
|
|
|
|
|
LL | in(reg) a,
|
|
|
|
| ^^^^^^^^^
|
2022-01-20 18:00:00 -06:00
|
|
|
LL |
|
2020-12-06 18:00:00 -06:00
|
|
|
LL | inlateout(reg) b,
|
|
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
LL | inout(reg) c,
|
|
|
|
| ^^^^^^^^^^^^
|
|
|
|
LL | lateout(reg) d,
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
LL | out(reg) e,
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2022-01-20 18:00:00 -06:00
|
|
|
error[E0787]: asm in naked functions must use `noreturn` option
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:62:5
|
2020-12-06 18:00:00 -06:00
|
|
|
|
|
|
|
|
LL | / asm!("/* {0} {1} {2} {3} {4} {5} {6} */",
|
|
|
|
LL | |
|
|
|
|
LL | | in(reg) a,
|
2022-01-20 18:00:00 -06:00
|
|
|
LL | |
|
2020-12-06 18:00:00 -06:00
|
|
|
... |
|
|
|
|
LL | | sym G,
|
|
|
|
LL | | );
|
2021-10-14 13:28:28 -05:00
|
|
|
| |_____^
|
2022-03-31 17:14:01 -05:00
|
|
|
|
|
2022-04-01 10:28:45 -05:00
|
|
|
help: consider specifying that the asm block is responsible for returning from the function
|
2022-03-31 17:14:01 -05:00
|
|
|
|
|
|
|
|
LL | sym G, options(noreturn),
|
|
|
|
| +++++++++++++++++++
|
2020-12-06 18:00:00 -06:00
|
|
|
|
2022-01-20 18:00:00 -06:00
|
|
|
error[E0787]: naked functions must contain a single asm block
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:53:1
|
2020-12-06 18:00:00 -06:00
|
|
|
|
|
2022-06-25 10:45:42 -05:00
|
|
|
LL | pub unsafe extern "C" fn unsupported_operands() {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
LL |
|
|
|
|
LL | let mut a = 0usize;
|
|
|
|
| ------------------- non-asm is unsupported in naked functions
|
|
|
|
LL | let mut b = 0usize;
|
|
|
|
| ------------------- non-asm is unsupported in naked functions
|
|
|
|
LL | let mut c = 0usize;
|
|
|
|
| ------------------- non-asm is unsupported in naked functions
|
|
|
|
LL | let mut d = 0usize;
|
|
|
|
| ------------------- non-asm is unsupported in naked functions
|
|
|
|
LL | let mut e = 0usize;
|
|
|
|
| ------------------- non-asm is unsupported in naked functions
|
2020-12-06 18:00:00 -06:00
|
|
|
|
2022-01-20 18:00:00 -06:00
|
|
|
error[E0787]: naked functions must contain a single asm block
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:76:1
|
2020-12-06 18:00:00 -06:00
|
|
|
|
|
2022-06-25 10:45:42 -05:00
|
|
|
LL | pub extern "C" fn missing_assembly() {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-12-06 18:00:00 -06:00
|
|
|
|
2022-01-20 18:00:00 -06:00
|
|
|
error[E0787]: asm in naked functions must use `noreturn` option
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:84:9
|
2020-12-06 18:00:00 -06:00
|
|
|
|
|
2024-02-01 16:45:00 -06:00
|
|
|
LL | asm!("");
|
|
|
|
| ^^^^^^^^
|
2022-03-31 17:14:01 -05:00
|
|
|
|
|
2022-04-01 10:28:45 -05:00
|
|
|
help: consider specifying that the asm block is responsible for returning from the function
|
2022-03-31 17:14:01 -05:00
|
|
|
|
|
2024-02-01 16:45:00 -06:00
|
|
|
LL | asm!("", options(noreturn));
|
|
|
|
| +++++++++++++++++++
|
2020-12-06 18:00:00 -06:00
|
|
|
|
2022-01-20 18:00:00 -06:00
|
|
|
error[E0787]: asm in naked functions must use `noreturn` option
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:86:9
|
2020-12-06 18:00:00 -06:00
|
|
|
|
|
2024-02-01 16:45:00 -06:00
|
|
|
LL | asm!("");
|
|
|
|
| ^^^^^^^^
|
2022-03-31 17:14:01 -05:00
|
|
|
|
|
2022-04-01 10:28:45 -05:00
|
|
|
help: consider specifying that the asm block is responsible for returning from the function
|
2022-03-31 17:14:01 -05:00
|
|
|
|
|
2024-02-01 16:45:00 -06:00
|
|
|
LL | asm!("", options(noreturn));
|
|
|
|
| +++++++++++++++++++
|
2020-12-06 18:00:00 -06:00
|
|
|
|
2022-01-20 18:00:00 -06:00
|
|
|
error[E0787]: asm in naked functions must use `noreturn` option
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:88:9
|
2020-12-06 18:00:00 -06:00
|
|
|
|
|
2024-02-01 16:45:00 -06:00
|
|
|
LL | asm!("");
|
|
|
|
| ^^^^^^^^
|
2022-03-31 17:14:01 -05:00
|
|
|
|
|
2022-04-01 10:28:45 -05:00
|
|
|
help: consider specifying that the asm block is responsible for returning from the function
|
2022-03-31 17:14:01 -05:00
|
|
|
|
|
2024-02-01 16:45:00 -06:00
|
|
|
LL | asm!("", options(noreturn));
|
|
|
|
| +++++++++++++++++++
|
2020-12-06 18:00:00 -06:00
|
|
|
|
2022-01-20 18:00:00 -06:00
|
|
|
error[E0787]: naked functions must contain a single asm block
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:81:1
|
2020-12-06 18:00:00 -06:00
|
|
|
|
|
2022-06-25 10:45:42 -05:00
|
|
|
LL | pub extern "C" fn too_many_asm_blocks() {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
...
|
2024-02-01 16:45:00 -06:00
|
|
|
LL | asm!("");
|
|
|
|
| -------- multiple asm blocks are unsupported in naked functions
|
2022-06-25 10:45:42 -05:00
|
|
|
LL |
|
2024-02-01 16:45:00 -06:00
|
|
|
LL | asm!("");
|
|
|
|
| -------- multiple asm blocks are unsupported in naked functions
|
2022-06-25 10:45:42 -05:00
|
|
|
LL |
|
2024-02-01 16:45:00 -06:00
|
|
|
LL | asm!("", options(noreturn));
|
|
|
|
| --------------------------- multiple asm blocks are unsupported in naked functions
|
2020-12-06 18:00:00 -06:00
|
|
|
|
|
|
|
error: referencing function parameters is not allowed in naked functions
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:98:11
|
2020-12-06 18:00:00 -06:00
|
|
|
|
|
|
|
|
LL | *&y
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
= help: follow the calling convention in asm block to use parameters
|
|
|
|
|
2022-01-20 18:00:00 -06:00
|
|
|
error[E0787]: naked functions must contain a single asm block
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:96:5
|
2020-12-06 18:00:00 -06:00
|
|
|
|
|
2022-06-25 10:45:42 -05:00
|
|
|
LL | pub extern "C" fn inner(y: usize) -> usize {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
LL |
|
|
|
|
LL | *&y
|
|
|
|
| --- non-asm is unsupported in naked functions
|
2020-12-06 18:00:00 -06:00
|
|
|
|
2022-01-20 18:00:00 -06:00
|
|
|
error[E0787]: asm options unsupported in naked functions: `nomem`, `preserves_flags`
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:106:5
|
2020-12-06 18:00:00 -06:00
|
|
|
|
|
|
|
|
LL | asm!("", options(nomem, preserves_flags, noreturn));
|
2021-10-14 13:28:28 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-12-06 18:00:00 -06:00
|
|
|
|
2022-01-20 18:00:00 -06:00
|
|
|
error[E0787]: asm options unsupported in naked functions: `nostack`, `pure`, `readonly`
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:112:5
|
2020-12-06 18:00:00 -06:00
|
|
|
|
|
|
|
|
LL | asm!("", options(readonly, nostack), options(pure));
|
2021-10-14 13:28:28 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-12-06 18:00:00 -06:00
|
|
|
|
2022-01-20 18:00:00 -06:00
|
|
|
error[E0787]: asm in naked functions must use `noreturn` option
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:112:5
|
2020-12-06 18:00:00 -06:00
|
|
|
|
|
|
|
|
LL | asm!("", options(readonly, nostack), options(pure));
|
2021-10-14 13:28:28 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-03-31 17:14:01 -05:00
|
|
|
|
|
2022-04-01 10:28:45 -05:00
|
|
|
help: consider specifying that the asm block is responsible for returning from the function
|
2022-03-31 17:14:01 -05:00
|
|
|
|
|
|
|
|
LL | asm!("", options(noreturn), options(readonly, nostack), options(pure));
|
|
|
|
| +++++++++++++++++++
|
2020-12-06 18:00:00 -06:00
|
|
|
|
2022-01-20 18:00:00 -06:00
|
|
|
error[E0787]: asm options unsupported in naked functions: `may_unwind`
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:120:5
|
2022-01-20 18:00:00 -06:00
|
|
|
|
|
|
|
|
LL | asm!("", options(noreturn, may_unwind));
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2020-12-06 18:00:00 -06:00
|
|
|
warning: Rust ABI is unsupported in naked functions
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:125:1
|
2020-12-06 18:00:00 -06:00
|
|
|
|
|
|
|
|
LL | pub unsafe fn default_abi() {
|
2022-06-25 10:45:42 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-12-06 18:00:00 -06:00
|
|
|
|
|
2021-08-04 14:00:49 -05:00
|
|
|
= note: `#[warn(undefined_naked_function_abi)]` on by default
|
2020-12-06 18:00:00 -06:00
|
|
|
|
|
|
|
warning: Rust ABI is unsupported in naked functions
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:131:1
|
2020-12-06 18:00:00 -06:00
|
|
|
|
|
2021-10-27 12:37:18 -05:00
|
|
|
LL | pub unsafe fn rust_abi() {
|
2022-06-25 10:45:42 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-12-06 18:00:00 -06:00
|
|
|
|
2022-01-20 18:00:00 -06:00
|
|
|
error: naked functions cannot be inlined
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:171:1
|
2021-08-02 14:03:43 -05:00
|
|
|
|
|
|
|
|
LL | #[inline]
|
|
|
|
| ^^^^^^^^^
|
|
|
|
|
2022-01-20 18:00:00 -06:00
|
|
|
error: naked functions cannot be inlined
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:178:1
|
2021-08-02 14:03:43 -05:00
|
|
|
|
|
|
|
|
LL | #[inline(always)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
2022-01-20 18:00:00 -06:00
|
|
|
error: naked functions cannot be inlined
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:185:1
|
2021-08-02 14:03:43 -05:00
|
|
|
|
|
|
|
|
LL | #[inline(never)]
|
|
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
2022-01-20 18:00:00 -06:00
|
|
|
error: naked functions cannot be inlined
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:192:1
|
2021-08-02 14:03:43 -05:00
|
|
|
|
|
|
|
|
LL | #[inline]
|
|
|
|
| ^^^^^^^^^
|
|
|
|
|
2022-01-20 18:00:00 -06:00
|
|
|
error: naked functions cannot be inlined
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:194:1
|
2021-08-02 14:03:43 -05:00
|
|
|
|
|
|
|
|
LL | #[inline(always)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
2022-01-20 18:00:00 -06:00
|
|
|
error: naked functions cannot be inlined
|
2024-03-06 14:44:54 -06:00
|
|
|
--> $DIR/naked-functions.rs:196:1
|
2021-08-02 14:03:43 -05:00
|
|
|
|
|
|
|
|
LL | #[inline(never)]
|
|
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
2022-04-14 08:29:42 -05:00
|
|
|
error: aborting due to 33 previous errors; 2 warnings emitted
|
2020-12-06 18:00:00 -06:00
|
|
|
|
2022-01-20 18:00:00 -06:00
|
|
|
For more information about this error, try `rustc --explain E0787`.
|