mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 14:01:51 +00:00
5fc60d1e52
- fix for divergence - fix error message - fix another cranelift test - fix some cranelift things - don't set the NORETURN option for naked asm - fix use of naked_asm! in doc comment - fix use of naked_asm! in run-make test - use `span_bug` in unreachable branch
195 lines
6.7 KiB
Plaintext
195 lines
6.7 KiB
Plaintext
error: the `in` operand cannot be used with `naked_asm!`
|
|
--> $DIR/naked-functions.rs:47:29
|
|
|
|
|
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
|
|
|
|
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
|
|
|
|
error: patterns not allowed in naked function parameters
|
|
--> $DIR/naked-functions.rs:25:5
|
|
|
|
|
LL | mut a: u32,
|
|
| ^^^^^
|
|
|
|
error: patterns not allowed in naked function parameters
|
|
--> $DIR/naked-functions.rs:27:5
|
|
|
|
|
LL | &b: &i32,
|
|
| ^^
|
|
|
|
error: patterns not allowed in naked function parameters
|
|
--> $DIR/naked-functions.rs:29:6
|
|
|
|
|
LL | (None | Some(_)): Option<std::ptr::NonNull<u8>>,
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
error: patterns not allowed in naked function parameters
|
|
--> $DIR/naked-functions.rs:31:5
|
|
|
|
|
LL | P { x, y }: P,
|
|
| ^^^^^^^^^^
|
|
|
|
error: referencing function parameters is not allowed in naked functions
|
|
--> $DIR/naked-functions.rs:40:5
|
|
|
|
|
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
|
|
|
|
|
LL | pub unsafe extern "C" fn inc(a: u32) -> u32 {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
LL |
|
|
LL | a + 1
|
|
| ----- not allowed in naked functions
|
|
|
|
error[E0787]: naked functions must contain a single `naked_asm!` invocation
|
|
--> $DIR/naked-functions.rs:52:1
|
|
|
|
|
LL | pub unsafe extern "C" fn inc_closure(a: u32) -> u32 {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
LL |
|
|
LL | (|| a + 1)()
|
|
| ------------ not allowed in naked functions
|
|
|
|
error[E0787]: naked functions must contain a single `naked_asm!` invocation
|
|
--> $DIR/naked-functions.rs:58:1
|
|
|
|
|
LL | pub unsafe extern "C" fn unsupported_operands() {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
LL |
|
|
LL | let mut a = 0usize;
|
|
| ------------------- not allowed in naked functions
|
|
LL | let mut b = 0usize;
|
|
| ------------------- not allowed in naked functions
|
|
LL | let mut c = 0usize;
|
|
| ------------------- not allowed in naked functions
|
|
LL | let mut d = 0usize;
|
|
| ------------------- not allowed in naked functions
|
|
LL | let mut e = 0usize;
|
|
| ------------------- not allowed in naked functions
|
|
|
|
error[E0787]: naked functions must contain a single `naked_asm!` invocation
|
|
--> $DIR/naked-functions.rs:80:1
|
|
|
|
|
LL | pub extern "C" fn missing_assembly() {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error[E0787]: naked functions must contain a single `naked_asm!` invocation
|
|
--> $DIR/naked-functions.rs:85:1
|
|
|
|
|
LL | pub extern "C" fn too_many_asm_blocks() {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
...
|
|
LL | naked_asm!("");
|
|
| -------------- multiple `naked_asm!` invocations are not allowed in naked functions
|
|
|
|
error: referencing function parameters is not allowed in naked functions
|
|
--> $DIR/naked-functions.rs:98:11
|
|
|
|
|
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
|
|
|
|
|
LL | pub extern "C" fn inner(y: usize) -> usize {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
LL |
|
|
LL | *&y
|
|
| --- not allowed in naked functions
|
|
|
|
warning: Rust ABI is unsupported in naked functions
|
|
--> $DIR/naked-functions.rs:126:1
|
|
|
|
|
LL | pub unsafe fn default_abi() {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `#[warn(undefined_naked_function_abi)]` on by default
|
|
|
|
warning: Rust ABI is unsupported in naked functions
|
|
--> $DIR/naked-functions.rs:132:1
|
|
|
|
|
LL | pub unsafe fn rust_abi() {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: aborting due to 25 previous errors; 2 warnings emitted
|
|
|
|
For more information about this error, try `rustc --explain E0787`.
|