2021-07-29 09:15:50 +00:00
|
|
|
error: asm with the `pure` option must have at least one output
|
2022-04-14 12:07:36 +00:00
|
|
|
--> $DIR/naked-functions.rs:111:14
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
|
|
|
LL | asm!("", options(readonly, nostack), options(pure));
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^
|
|
|
|
|
2022-04-01 05:29:38 +00:00
|
|
|
error: this is a user specified error
|
2022-04-14 12:07:36 +00:00
|
|
|
--> $DIR/naked-functions.rs:203:5
|
2022-04-01 05:29:38 +00:00
|
|
|
|
|
|
|
|
LL | compile_error!("this is a user specified error")
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: this is a user specified error
|
2022-04-14 12:07:36 +00:00
|
|
|
--> $DIR/naked-functions.rs:209:5
|
2022-04-01 05:29:38 +00:00
|
|
|
|
|
|
|
|
LL | compile_error!("this is a user specified error");
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2022-04-01 16:24:04 +00:00
|
|
|
error: asm template must be a string literal
|
2022-04-14 12:07:36 +00:00
|
|
|
--> $DIR/naked-functions.rs:216:10
|
2022-04-01 16:24:04 +00:00
|
|
|
|
|
|
|
|
LL | asm!(invalid_syntax)
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
2020-12-07 00:00:00 +00:00
|
|
|
error: patterns not allowed in naked function parameters
|
2022-01-19 15:24:49 +00:00
|
|
|
--> $DIR/naked-functions.rs:20:5
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
|
|
|
LL | mut a: u32,
|
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
error: patterns not allowed in naked function parameters
|
2022-01-19 15:24:49 +00:00
|
|
|
--> $DIR/naked-functions.rs:22:5
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
|
|
|
LL | &b: &i32,
|
|
|
|
| ^^
|
|
|
|
|
|
|
|
error: patterns not allowed in naked function parameters
|
2022-01-19 15:24:49 +00:00
|
|
|
--> $DIR/naked-functions.rs:24: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
|
2022-01-19 15:24:49 +00:00
|
|
|
--> $DIR/naked-functions.rs:26:5
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
|
|
|
LL | P { x, y }: P,
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: referencing function parameters is not allowed in naked functions
|
2022-01-19 15:24:49 +00:00
|
|
|
--> $DIR/naked-functions.rs:35:5
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
|
|
|
LL | a + 1
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
= help: follow the calling convention in asm block to use parameters
|
|
|
|
|
2022-01-21 00:00:00 +00:00
|
|
|
error[E0787]: naked functions must contain a single asm block
|
2022-01-19 15:24:49 +00:00
|
|
|
--> $DIR/naked-functions.rs:33:1
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
|
|
|
LL | / pub unsafe extern "C" fn inc(a: u32) -> u32 {
|
|
|
|
LL | |
|
|
|
|
LL | | a + 1
|
|
|
|
| | ----- non-asm is unsupported in naked functions
|
|
|
|
LL | |
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
error: referencing function parameters is not allowed in naked functions
|
2022-01-19 15:24:49 +00:00
|
|
|
--> $DIR/naked-functions.rs:41:31
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
|
|
|
LL | asm!("/* {0} */", in(reg) a, options(noreturn));
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
= help: follow the calling convention in asm block to use parameters
|
|
|
|
|
2022-01-21 00:00:00 +00:00
|
|
|
error[E0787]: only `const` and `sym` operands are supported in naked functions
|
2022-01-19 15:24:49 +00:00
|
|
|
--> $DIR/naked-functions.rs:41:23
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
|
|
|
LL | asm!("/* {0} */", in(reg) a, options(noreturn));
|
|
|
|
| ^^^^^^^^^
|
|
|
|
|
2022-01-21 00:00:00 +00:00
|
|
|
error[E0787]: naked functions must contain a single asm block
|
2022-04-14 12:07:36 +00:00
|
|
|
--> $DIR/naked-functions.rs:48:1
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
|
|
|
LL | / pub unsafe extern "C" fn inc_closure(a: u32) -> u32 {
|
|
|
|
LL | |
|
|
|
|
LL | | (|| a + 1)()
|
|
|
|
| | ------------ non-asm is unsupported in naked functions
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
2022-01-21 00:00:00 +00:00
|
|
|
error[E0787]: only `const` and `sym` operands are supported in naked functions
|
2022-04-14 12:07:36 +00:00
|
|
|
--> $DIR/naked-functions.rs:65:10
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
|
|
|
LL | in(reg) a,
|
|
|
|
| ^^^^^^^^^
|
2022-01-21 00:00:00 +00:00
|
|
|
LL |
|
2020-12-07 00:00:00 +00:00
|
|
|
LL | inlateout(reg) b,
|
|
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
LL | inout(reg) c,
|
|
|
|
| ^^^^^^^^^^^^
|
|
|
|
LL | lateout(reg) d,
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
LL | out(reg) e,
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2022-01-21 00:00:00 +00:00
|
|
|
error[E0787]: asm in naked functions must use `noreturn` option
|
2022-04-14 12:07:36 +00:00
|
|
|
--> $DIR/naked-functions.rs:63:5
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
|
|
|
LL | / asm!("/* {0} {1} {2} {3} {4} {5} {6} */",
|
|
|
|
LL | |
|
|
|
|
LL | | in(reg) a,
|
2022-01-21 00:00:00 +00:00
|
|
|
LL | |
|
2020-12-07 00:00:00 +00:00
|
|
|
... |
|
|
|
|
LL | | sym G,
|
|
|
|
LL | | );
|
2021-10-14 18:28:28 +00:00
|
|
|
| |_____^
|
2022-03-31 22:14:01 +00:00
|
|
|
|
|
2022-04-01 15:28:45 +00:00
|
|
|
help: consider specifying that the asm block is responsible for returning from the function
|
2022-03-31 22:14:01 +00:00
|
|
|
|
|
|
|
|
LL | sym G, options(noreturn),
|
|
|
|
| +++++++++++++++++++
|
2020-12-07 00:00:00 +00:00
|
|
|
|
2022-01-21 00:00:00 +00:00
|
|
|
error[E0787]: naked functions must contain a single asm block
|
2022-04-14 12:07:36 +00:00
|
|
|
--> $DIR/naked-functions.rs:54:1
|
2020-12-07 00:00:00 +00: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
|
|
|
|
... |
|
|
|
|
LL | | );
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
2022-01-21 00:00:00 +00:00
|
|
|
error[E0787]: naked functions must contain a single asm block
|
2022-04-14 12:07:36 +00:00
|
|
|
--> $DIR/naked-functions.rs:77:1
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
|
|
|
LL | / pub extern "C" fn missing_assembly() {
|
|
|
|
LL | |
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
2022-01-21 00:00:00 +00:00
|
|
|
error[E0787]: asm in naked functions must use `noreturn` option
|
2022-04-14 12:07:36 +00:00
|
|
|
--> $DIR/naked-functions.rs:84:5
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
|
|
|
LL | asm!("");
|
2021-10-14 18:28:28 +00:00
|
|
|
| ^^^^^^^^
|
2022-03-31 22:14:01 +00:00
|
|
|
|
|
2022-04-01 15:28:45 +00:00
|
|
|
help: consider specifying that the asm block is responsible for returning from the function
|
2022-03-31 22:14:01 +00:00
|
|
|
|
|
|
|
|
LL | asm!("", options(noreturn));
|
|
|
|
| +++++++++++++++++++
|
2020-12-07 00:00:00 +00:00
|
|
|
|
2022-01-21 00:00:00 +00:00
|
|
|
error[E0787]: asm in naked functions must use `noreturn` option
|
2022-04-14 12:07:36 +00:00
|
|
|
--> $DIR/naked-functions.rs:86:5
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
|
|
|
LL | asm!("");
|
2021-10-14 18:28:28 +00:00
|
|
|
| ^^^^^^^^
|
2022-03-31 22:14:01 +00:00
|
|
|
|
|
2022-04-01 15:28:45 +00:00
|
|
|
help: consider specifying that the asm block is responsible for returning from the function
|
2022-03-31 22:14:01 +00:00
|
|
|
|
|
|
|
|
LL | asm!("", options(noreturn));
|
|
|
|
| +++++++++++++++++++
|
2020-12-07 00:00:00 +00:00
|
|
|
|
2022-01-21 00:00:00 +00:00
|
|
|
error[E0787]: asm in naked functions must use `noreturn` option
|
2022-04-14 12:07:36 +00:00
|
|
|
--> $DIR/naked-functions.rs:88:5
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
|
|
|
LL | asm!("");
|
2021-10-14 18:28:28 +00:00
|
|
|
| ^^^^^^^^
|
2022-03-31 22:14:01 +00:00
|
|
|
|
|
2022-04-01 15:28:45 +00:00
|
|
|
help: consider specifying that the asm block is responsible for returning from the function
|
2022-03-31 22:14:01 +00:00
|
|
|
|
|
|
|
|
LL | asm!("", options(noreturn));
|
|
|
|
| +++++++++++++++++++
|
2020-12-07 00:00:00 +00:00
|
|
|
|
2022-01-21 00:00:00 +00:00
|
|
|
error[E0787]: naked functions must contain a single asm block
|
2022-04-14 12:07:36 +00:00
|
|
|
--> $DIR/naked-functions.rs:82:1
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
|
|
|
LL | / pub extern "C" fn too_many_asm_blocks() {
|
|
|
|
LL | |
|
|
|
|
LL | | asm!("");
|
2022-01-21 00:00:00 +00:00
|
|
|
LL | |
|
2020-12-07 00:00:00 +00:00
|
|
|
LL | | asm!("");
|
2021-10-14 18:28:28 +00:00
|
|
|
| | -------- multiple asm blocks are unsupported in naked functions
|
2022-01-21 00:00:00 +00:00
|
|
|
LL | |
|
2020-12-07 00:00:00 +00:00
|
|
|
LL | | asm!("");
|
2021-10-14 18:28:28 +00:00
|
|
|
| | -------- multiple asm blocks are unsupported in naked functions
|
2022-01-21 00:00:00 +00:00
|
|
|
LL | |
|
2020-12-07 00:00:00 +00:00
|
|
|
LL | | asm!("", options(noreturn));
|
2021-10-14 18:28:28 +00:00
|
|
|
| | --------------------------- multiple asm blocks are unsupported in naked functions
|
2020-12-07 00:00:00 +00:00
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
error: referencing function parameters is not allowed in naked functions
|
2022-04-14 12:07:36 +00: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
|
|
|
|
|
2022-01-21 00:00:00 +00:00
|
|
|
error[E0787]: naked functions must contain a single asm block
|
2022-04-14 12:07:36 +00:00
|
|
|
--> $DIR/naked-functions.rs:95:5
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
|
|
|
LL | / pub extern "C" fn inner(y: usize) -> usize {
|
|
|
|
LL | |
|
|
|
|
LL | | *&y
|
|
|
|
| | --- non-asm is unsupported in naked functions
|
|
|
|
LL | |
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
2022-01-21 00:00:00 +00:00
|
|
|
error[E0787]: asm options unsupported in naked functions: `nomem`, `preserves_flags`
|
2022-04-14 12:07:36 +00:00
|
|
|
--> $DIR/naked-functions.rs:105:5
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
|
|
|
LL | asm!("", options(nomem, preserves_flags, noreturn));
|
2021-10-14 18:28:28 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-12-07 00:00:00 +00:00
|
|
|
|
2022-01-21 00:00:00 +00:00
|
|
|
error[E0787]: asm options unsupported in naked functions: `nostack`, `pure`, `readonly`
|
2022-04-14 12:07:36 +00:00
|
|
|
--> $DIR/naked-functions.rs:111:5
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
|
|
|
LL | asm!("", options(readonly, nostack), options(pure));
|
2021-10-14 18:28:28 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-12-07 00:00:00 +00:00
|
|
|
|
2022-01-21 00:00:00 +00:00
|
|
|
error[E0787]: asm in naked functions must use `noreturn` option
|
2022-04-14 12:07:36 +00:00
|
|
|
--> $DIR/naked-functions.rs:111:5
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
|
|
|
LL | asm!("", options(readonly, nostack), options(pure));
|
2021-10-14 18:28:28 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-03-31 22:14:01 +00:00
|
|
|
|
|
2022-04-01 15:28:45 +00:00
|
|
|
help: consider specifying that the asm block is responsible for returning from the function
|
2022-03-31 22:14:01 +00:00
|
|
|
|
|
|
|
|
LL | asm!("", options(noreturn), options(readonly, nostack), options(pure));
|
|
|
|
| +++++++++++++++++++
|
2020-12-07 00:00:00 +00:00
|
|
|
|
2022-01-21 00:00:00 +00:00
|
|
|
error[E0787]: asm options unsupported in naked functions: `may_unwind`
|
2022-04-14 12:07:36 +00:00
|
|
|
--> $DIR/naked-functions.rs:119:5
|
2022-01-21 00:00:00 +00:00
|
|
|
|
|
|
|
|
LL | asm!("", options(noreturn, may_unwind));
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2020-12-07 00:00:00 +00:00
|
|
|
warning: Rust ABI is unsupported in naked functions
|
2022-04-14 12:07:36 +00:00
|
|
|
--> $DIR/naked-functions.rs:124:15
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
|
|
|
LL | pub unsafe fn default_abi() {
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
2021-08-04 19:00:49 +00:00
|
|
|
= note: `#[warn(undefined_naked_function_abi)]` on by default
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
|
|
warning: Rust ABI is unsupported in naked functions
|
2022-04-14 12:07:36 +00:00
|
|
|
--> $DIR/naked-functions.rs:130:15
|
2020-12-07 00:00:00 +00:00
|
|
|
|
|
2021-10-27 17:37:18 +00:00
|
|
|
LL | pub unsafe fn rust_abi() {
|
|
|
|
| ^^^^^^^^
|
2020-12-07 00:00:00 +00:00
|
|
|
|
2022-01-21 00:00:00 +00:00
|
|
|
error: naked functions cannot be inlined
|
2022-04-14 12:07:36 +00:00
|
|
|
--> $DIR/naked-functions.rs:170:1
|
2021-08-02 19:03:43 +00:00
|
|
|
|
|
|
|
|
LL | #[inline]
|
|
|
|
| ^^^^^^^^^
|
|
|
|
|
2022-01-21 00:00:00 +00:00
|
|
|
error: naked functions cannot be inlined
|
2022-04-14 12:07:36 +00:00
|
|
|
--> $DIR/naked-functions.rs:177:1
|
2021-08-02 19:03:43 +00:00
|
|
|
|
|
|
|
|
LL | #[inline(always)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
2022-01-21 00:00:00 +00:00
|
|
|
error: naked functions cannot be inlined
|
2022-04-14 12:07:36 +00:00
|
|
|
--> $DIR/naked-functions.rs:184:1
|
2021-08-02 19:03:43 +00:00
|
|
|
|
|
|
|
|
LL | #[inline(never)]
|
|
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
2022-01-21 00:00:00 +00:00
|
|
|
error: naked functions cannot be inlined
|
2022-04-14 12:07:36 +00:00
|
|
|
--> $DIR/naked-functions.rs:191:1
|
2021-08-02 19:03:43 +00:00
|
|
|
|
|
|
|
|
LL | #[inline]
|
|
|
|
| ^^^^^^^^^
|
|
|
|
|
2022-01-21 00:00:00 +00:00
|
|
|
error: naked functions cannot be inlined
|
2022-04-14 12:07:36 +00:00
|
|
|
--> $DIR/naked-functions.rs:193:1
|
2021-08-02 19:03:43 +00:00
|
|
|
|
|
|
|
|
LL | #[inline(always)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
2022-01-21 00:00:00 +00:00
|
|
|
error: naked functions cannot be inlined
|
2022-04-14 12:07:36 +00:00
|
|
|
--> $DIR/naked-functions.rs:195:1
|
2021-08-02 19:03:43 +00:00
|
|
|
|
|
|
|
|
LL | #[inline(never)]
|
|
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
2022-04-14 12:07:36 +00:00
|
|
|
warning: formatting may not be suitable for sub-register argument
|
|
|
|
--> $DIR/naked-functions.rs:41:14
|
|
|
|
|
|
|
|
|
LL | asm!("/* {0} */", in(reg) a, options(noreturn));
|
|
|
|
| ^^^ - for this argument
|
|
|
|
|
|
|
|
|
= note: `#[warn(asm_sub_register)]` on by default
|
|
|
|
= help: use the `e` modifier to have the register formatted as `eax`
|
|
|
|
= help: or use the `r` modifier to keep the default formatting of `rax`
|
|
|
|
|
|
|
|
error: aborting due to 33 previous errors; 3 warnings emitted
|
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`.
|