rust/tests/ui/asm/naked-functions.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

195 lines
6.7 KiB
Plaintext
Raw Permalink Normal View History

error: the `in` operand cannot be used with `naked_asm!`
--> $DIR/naked-functions.rs:47:29
2020-12-06 18:00:00 -06:00
|
LL | naked_asm!("/* {0} */", in(reg) a)
| ^^ the `in` operand is not meaningful for global-scoped inline assembly, remove it
error: the `in` operand cannot be used with `naked_asm!`
--> $DIR/naked-functions.rs:68:10
|
LL | in(reg) a,
| ^^ the `in` operand is not meaningful for global-scoped inline assembly, remove it
error: the `noreturn` option cannot be used with `naked_asm!`
--> $DIR/naked-functions.rs:88:32
|
LL | naked_asm!("", options(noreturn));
| ^^^^^^^^ the `noreturn` option is not meaningful for global-scoped inline assembly
error: the `nomem` option cannot be used with `naked_asm!`
--> $DIR/naked-functions.rs:106:28
|
LL | naked_asm!("", options(nomem, preserves_flags));
| ^^^^^ the `nomem` option is not meaningful for global-scoped inline assembly
error: the `preserves_flags` option cannot be used with `naked_asm!`
--> $DIR/naked-functions.rs:106:35
|
LL | naked_asm!("", options(nomem, preserves_flags));
| ^^^^^^^^^^^^^^^ the `preserves_flags` option is not meaningful for global-scoped inline assembly
error: the `readonly` option cannot be used with `naked_asm!`
--> $DIR/naked-functions.rs:113:28
|
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!`
--> $DIR/naked-functions.rs:113:38
|
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!`
--> $DIR/naked-functions.rs:113:56
|
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!`
--> $DIR/naked-functions.rs:121:28
|
LL | naked_asm!("", options(may_unwind));
| ^^^^^^^^^^ the `may_unwind` option is not meaningful for global-scoped inline assembly
2020-12-06 18:00:00 -06:00
error: this is a user specified error
--> $DIR/naked-functions.rs:169:5
|
LL | compile_error!("this is a user specified error")
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: this is a user specified error
--> $DIR/naked-functions.rs:175:5
|
LL | compile_error!("this is a user specified error");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: asm template must be a string literal
--> $DIR/naked-functions.rs:182:16
|
LL | naked_asm!(invalid_syntax)
| ^^^^^^^^^^^^^^
error[E0787]: the `asm!` macro is not allowed in naked functions
--> $DIR/naked-functions.rs:13:5
|
LL | asm!("", options(raw));
| ^^^^^^^^^^^^^^^^^^^^^^ consider using the `naked_asm!` macro instead
2020-12-06 18:00:00 -06:00
error: patterns not allowed in naked function parameters
--> $DIR/naked-functions.rs:25:5
2020-12-06 18:00:00 -06:00
|
LL | mut a: u32,
| ^^^^^
error: patterns not allowed in naked function parameters
--> $DIR/naked-functions.rs:27:5
2020-12-06 18:00:00 -06:00
|
LL | &b: &i32,
| ^^
error: patterns not allowed in naked function parameters
--> $DIR/naked-functions.rs:29: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
--> $DIR/naked-functions.rs:31:5
2020-12-06 18:00:00 -06:00
|
LL | P { x, y }: P,
| ^^^^^^^^^^
error: referencing function parameters is not allowed in naked functions
--> $DIR/naked-functions.rs:40:5
2020-12-06 18:00:00 -06:00
|
LL | a + 1
| ^
|
= help: follow the calling convention in asm block to use parameters
error[E0787]: naked functions must contain a single `naked_asm!` invocation
--> $DIR/naked-functions.rs:38: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
| ----- not allowed in naked functions
2020-12-06 18:00:00 -06:00
error[E0787]: naked functions must contain a single `naked_asm!` invocation
--> $DIR/naked-functions.rs:52: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)()
| ------------ not allowed in naked functions
2020-12-06 18:00:00 -06:00
error[E0787]: naked functions must contain a single `naked_asm!` invocation
--> $DIR/naked-functions.rs:58: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;
| ------------------- not allowed in naked functions
2022-06-25 10:45:42 -05:00
LL | let mut b = 0usize;
| ------------------- not allowed in naked functions
2022-06-25 10:45:42 -05:00
LL | let mut c = 0usize;
| ------------------- not allowed in naked functions
2022-06-25 10:45:42 -05:00
LL | let mut d = 0usize;
| ------------------- not allowed in naked functions
2022-06-25 10:45:42 -05:00
LL | let mut e = 0usize;
| ------------------- not allowed in naked functions
2020-12-06 18:00:00 -06:00
error[E0787]: naked functions must contain a single `naked_asm!` invocation
--> $DIR/naked-functions.rs:80: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
error[E0787]: naked functions must contain a single `naked_asm!` invocation
--> $DIR/naked-functions.rs:85: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() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
LL | naked_asm!("");
| -------------- multiple `naked_asm!` invocations are not allowed in naked functions
2020-12-06 18:00:00 -06:00
error: referencing function parameters is not allowed in naked functions
--> $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
error[E0787]: naked functions must contain a single `naked_asm!` invocation
--> $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
| --- not allowed in naked functions
2020-12-06 18:00:00 -06:00
warning: Rust ABI is unsupported in naked functions
--> $DIR/naked-functions.rs:126: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
|
= 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
--> $DIR/naked-functions.rs:132:1
2020-12-06 18:00:00 -06:00
|
LL | pub unsafe fn rust_abi() {
2022-06-25 10:45:42 -05:00
| ^^^^^^^^^^^^^^^^^^^^^^^^
2020-12-06 18:00:00 -06:00
error: aborting due to 25 previous errors; 2 warnings emitted
2020-12-06 18:00:00 -06:00
For more information about this error, try `rustc --explain E0787`.