diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:11:28 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:11:28 +0000 |
commit | 94a0819fe3a0d679c3042a77bfe6a2afc505daea (patch) | |
tree | 2b827afe6a05f3538db3f7803a88c4587fe85648 /src/test/ui/asm | |
parent | Adding upstream version 1.64.0+dfsg1. (diff) | |
download | rustc-94a0819fe3a0d679c3042a77bfe6a2afc505daea.tar.xz rustc-94a0819fe3a0d679c3042a77bfe6a2afc505daea.zip |
Adding upstream version 1.66.0+dfsg1.upstream/1.66.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/asm')
32 files changed, 140 insertions, 127 deletions
diff --git a/src/test/ui/asm/aarch64/bad-reg.rs b/src/test/ui/asm/aarch64/bad-reg.rs index 2b6a9b71c..9ccb8ed67 100644 --- a/src/test/ui/asm/aarch64/bad-reg.rs +++ b/src/test/ui/asm/aarch64/bad-reg.rs @@ -1,7 +1,7 @@ // only-aarch64 // compile-flags: -C target-feature=+neon -#![feature(asm_const, asm_sym)] +#![feature(asm_const)] use std::arch::asm; diff --git a/src/test/ui/asm/aarch64/may_unwind.rs b/src/test/ui/asm/aarch64/may_unwind.rs index ac8cc6202..6af8728bb 100644 --- a/src/test/ui/asm/aarch64/may_unwind.rs +++ b/src/test/ui/asm/aarch64/may_unwind.rs @@ -1,9 +1,8 @@ -// min-llvm-version: 13.0.0 // only-aarch64 // run-pass // needs-asm-support -#![feature(asm_sym, asm_unwind)] +#![feature(asm_unwind)] use std::arch::asm; use std::panic::{catch_unwind, resume_unwind, AssertUnwindSafe}; diff --git a/src/test/ui/asm/aarch64/sym.rs b/src/test/ui/asm/aarch64/sym.rs index 3f659363c..6a6cdb00d 100644 --- a/src/test/ui/asm/aarch64/sym.rs +++ b/src/test/ui/asm/aarch64/sym.rs @@ -3,7 +3,7 @@ // needs-asm-support // run-pass -#![feature(thread_local, asm_sym)] +#![feature(thread_local)] use std::arch::asm; diff --git a/src/test/ui/asm/aarch64/type-check-2-2.rs b/src/test/ui/asm/aarch64/type-check-2-2.rs index aa12d4aa4..0ce1f1d8f 100644 --- a/src/test/ui/asm/aarch64/type-check-2-2.rs +++ b/src/test/ui/asm/aarch64/type-check-2-2.rs @@ -1,6 +1,6 @@ // only-aarch64 -#![feature(repr_simd, never_type, asm_sym)] +#![feature(repr_simd, never_type)] use std::arch::{asm, global_asm}; diff --git a/src/test/ui/asm/aarch64/type-check-2-2.stderr b/src/test/ui/asm/aarch64/type-check-2-2.stderr index b2a695529..eef16a165 100644 --- a/src/test/ui/asm/aarch64/type-check-2-2.stderr +++ b/src/test/ui/asm/aarch64/type-check-2-2.stderr @@ -5,6 +5,11 @@ LL | let x: u64; | - binding declared here but left uninitialized LL | asm!("{}", in(reg) x); | ^ `x` used here but it isn't initialized + | +help: consider assigning a value + | +LL | let x: u64 = 0; + | +++ error[E0381]: used binding `y` isn't initialized --> $DIR/type-check-2-2.rs:22:9 @@ -13,6 +18,11 @@ LL | let mut y: u64; | ----- binding declared here but left uninitialized LL | asm!("{}", inout(reg) y); | ^^^^^^^^^^^^^^^^^^^^^^^^ `y` used here but it isn't initialized + | +help: consider assigning a value + | +LL | let mut y: u64 = 0; + | +++ error[E0596]: cannot borrow `v` as mutable, as it is not declared as mutable --> $DIR/type-check-2-2.rs:30:29 diff --git a/src/test/ui/asm/aarch64/type-check-2.rs b/src/test/ui/asm/aarch64/type-check-2.rs index fdafe63c7..1c71c1185 100644 --- a/src/test/ui/asm/aarch64/type-check-2.rs +++ b/src/test/ui/asm/aarch64/type-check-2.rs @@ -1,6 +1,6 @@ // only-aarch64 -#![feature(repr_simd, never_type, asm_sym)] +#![feature(repr_simd, never_type)] use std::arch::{asm, global_asm}; diff --git a/src/test/ui/asm/aarch64/type-check-3.stderr b/src/test/ui/asm/aarch64/type-check-3.stderr index b320abdc0..f710df2dc 100644 --- a/src/test/ui/asm/aarch64/type-check-3.stderr +++ b/src/test/ui/asm/aarch64/type-check-3.stderr @@ -4,9 +4,9 @@ warning: formatting may not be suitable for sub-register argument LL | asm!("{}", in(reg) 0u8); | ^^ --- for this argument | + = help: use `{0:w}` to have the register formatted as `w0` + = help: or use `{0:x}` to keep the default formatting of `x0` = note: `#[warn(asm_sub_register)]` on by default - = help: use the `w` modifier to have the register formatted as `w0` - = help: or use the `x` modifier to keep the default formatting of `x0` warning: formatting may not be suitable for sub-register argument --> $DIR/type-check-3.rs:50:15 @@ -14,8 +14,8 @@ warning: formatting may not be suitable for sub-register argument LL | asm!("{}", in(reg) 0u16); | ^^ ---- for this argument | - = help: use the `w` modifier to have the register formatted as `w0` - = help: or use the `x` modifier to keep the default formatting of `x0` + = help: use `{0:w}` to have the register formatted as `w0` + = help: or use `{0:x}` to keep the default formatting of `x0` warning: formatting may not be suitable for sub-register argument --> $DIR/type-check-3.rs:52:15 @@ -23,8 +23,8 @@ warning: formatting may not be suitable for sub-register argument LL | asm!("{}", in(reg) 0i32); | ^^ ---- for this argument | - = help: use the `w` modifier to have the register formatted as `w0` - = help: or use the `x` modifier to keep the default formatting of `x0` + = help: use `{0:w}` to have the register formatted as `w0` + = help: or use `{0:x}` to keep the default formatting of `x0` warning: formatting may not be suitable for sub-register argument --> $DIR/type-check-3.rs:54:15 @@ -32,8 +32,8 @@ warning: formatting may not be suitable for sub-register argument LL | asm!("{}", in(reg) 0f32); | ^^ ---- for this argument | - = help: use the `w` modifier to have the register formatted as `w0` - = help: or use the `x` modifier to keep the default formatting of `x0` + = help: use `{0:w}` to have the register formatted as `w0` + = help: or use `{0:x}` to keep the default formatting of `x0` warning: formatting may not be suitable for sub-register argument --> $DIR/type-check-3.rs:57:15 @@ -41,8 +41,8 @@ warning: formatting may not be suitable for sub-register argument LL | asm!("{}", in(vreg) 0i16); | ^^ ---- for this argument | - = help: use the `h` modifier to have the register formatted as `h0` - = help: or use the `v` modifier to keep the default formatting of `v0` + = help: use `{0:h}` to have the register formatted as `h0` + = help: or use `{0:v}` to keep the default formatting of `v0` warning: formatting may not be suitable for sub-register argument --> $DIR/type-check-3.rs:59:15 @@ -50,8 +50,8 @@ warning: formatting may not be suitable for sub-register argument LL | asm!("{}", in(vreg) 0f32); | ^^ ---- for this argument | - = help: use the `s` modifier to have the register formatted as `s0` - = help: or use the `v` modifier to keep the default formatting of `v0` + = help: use `{0:s}` to have the register formatted as `s0` + = help: or use `{0:v}` to keep the default formatting of `v0` warning: formatting may not be suitable for sub-register argument --> $DIR/type-check-3.rs:61:15 @@ -59,8 +59,8 @@ warning: formatting may not be suitable for sub-register argument LL | asm!("{}", in(vreg) 0f64); | ^^ ---- for this argument | - = help: use the `d` modifier to have the register formatted as `d0` - = help: or use the `v` modifier to keep the default formatting of `v0` + = help: use `{0:d}` to have the register formatted as `d0` + = help: or use `{0:v}` to keep the default formatting of `v0` warning: formatting may not be suitable for sub-register argument --> $DIR/type-check-3.rs:63:15 @@ -68,8 +68,8 @@ warning: formatting may not be suitable for sub-register argument LL | asm!("{}", in(vreg_low16) 0f64); | ^^ ---- for this argument | - = help: use the `d` modifier to have the register formatted as `d0` - = help: or use the `v` modifier to keep the default formatting of `v0` + = help: use `{0:d}` to have the register formatted as `d0` + = help: or use `{0:v}` to keep the default formatting of `v0` warning: formatting may not be suitable for sub-register argument --> $DIR/type-check-3.rs:66:15 @@ -77,8 +77,8 @@ warning: formatting may not be suitable for sub-register argument LL | asm!("{0} {0}", in(reg) 0i16); | ^^^ ^^^ ---- for this argument | - = help: use the `w` modifier to have the register formatted as `w0` - = help: or use the `x` modifier to keep the default formatting of `x0` + = help: use `{0:w}` to have the register formatted as `w0` + = help: or use `{0:x}` to keep the default formatting of `x0` warning: formatting may not be suitable for sub-register argument --> $DIR/type-check-3.rs:68:15 @@ -86,8 +86,8 @@ warning: formatting may not be suitable for sub-register argument LL | asm!("{0} {0:x}", in(reg) 0i16); | ^^^ ---- for this argument | - = help: use the `w` modifier to have the register formatted as `w0` - = help: or use the `x` modifier to keep the default formatting of `x0` + = help: use `{0:w}` to have the register formatted as `w0` + = help: or use `{0:x}` to keep the default formatting of `x0` error: type `i128` cannot be used with this register class --> $DIR/type-check-3.rs:73:28 diff --git a/src/test/ui/asm/bad-template.aarch64_mirunsafeck.stderr b/src/test/ui/asm/bad-template.aarch64_mirunsafeck.stderr index 7ef93e15f..bb6a222b2 100644 --- a/src/test/ui/asm/bad-template.aarch64_mirunsafeck.stderr +++ b/src/test/ui/asm/bad-template.aarch64_mirunsafeck.stderr @@ -189,9 +189,9 @@ warning: formatting may not be suitable for sub-register argument LL | asm!("{:foo}", in(reg) foo); | ^^^^^^ --- for this argument | + = help: use `{0:w}` to have the register formatted as `w0` + = help: or use `{0:x}` to keep the default formatting of `x0` = note: `#[warn(asm_sub_register)]` on by default - = help: use the `w` modifier to have the register formatted as `w0` - = help: or use the `x` modifier to keep the default formatting of `x0` error: aborting due to 21 previous errors; 1 warning emitted diff --git a/src/test/ui/asm/bad-template.aarch64_thirunsafeck.stderr b/src/test/ui/asm/bad-template.aarch64_thirunsafeck.stderr index 7ef93e15f..bb6a222b2 100644 --- a/src/test/ui/asm/bad-template.aarch64_thirunsafeck.stderr +++ b/src/test/ui/asm/bad-template.aarch64_thirunsafeck.stderr @@ -189,9 +189,9 @@ warning: formatting may not be suitable for sub-register argument LL | asm!("{:foo}", in(reg) foo); | ^^^^^^ --- for this argument | + = help: use `{0:w}` to have the register formatted as `w0` + = help: or use `{0:x}` to keep the default formatting of `x0` = note: `#[warn(asm_sub_register)]` on by default - = help: use the `w` modifier to have the register formatted as `w0` - = help: or use the `x` modifier to keep the default formatting of `x0` error: aborting due to 21 previous errors; 1 warning emitted diff --git a/src/test/ui/asm/bad-template.x86_64_mirunsafeck.stderr b/src/test/ui/asm/bad-template.x86_64_mirunsafeck.stderr index 250bc3be4..903b5e959 100644 --- a/src/test/ui/asm/bad-template.x86_64_mirunsafeck.stderr +++ b/src/test/ui/asm/bad-template.x86_64_mirunsafeck.stderr @@ -189,9 +189,9 @@ warning: formatting may not be suitable for sub-register argument LL | asm!("{:foo}", in(reg) foo); | ^^^^^^ --- for this argument | + = help: use `{0:e}` to have the register formatted as `eax` + = help: or use `{0:r}` to keep the default formatting of `rax` = 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 21 previous errors; 1 warning emitted diff --git a/src/test/ui/asm/bad-template.x86_64_thirunsafeck.stderr b/src/test/ui/asm/bad-template.x86_64_thirunsafeck.stderr index 250bc3be4..903b5e959 100644 --- a/src/test/ui/asm/bad-template.x86_64_thirunsafeck.stderr +++ b/src/test/ui/asm/bad-template.x86_64_thirunsafeck.stderr @@ -189,9 +189,9 @@ warning: formatting may not be suitable for sub-register argument LL | asm!("{:foo}", in(reg) foo); | ^^^^^^ --- for this argument | + = help: use `{0:e}` to have the register formatted as `eax` + = help: or use `{0:r}` to keep the default formatting of `rax` = 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 21 previous errors; 1 warning emitted diff --git a/src/test/ui/asm/generic-const.rs b/src/test/ui/asm/generic-const.rs index 55c558780..caa9b7dbc 100644 --- a/src/test/ui/asm/generic-const.rs +++ b/src/test/ui/asm/generic-const.rs @@ -1,7 +1,7 @@ // needs-asm-support // build-pass -#![feature(asm_const, asm_sym)] +#![feature(asm_const)] use std::arch::asm; diff --git a/src/test/ui/asm/may_unwind.rs b/src/test/ui/asm/may_unwind.rs index 117c0a63a..b9479c44b 100644 --- a/src/test/ui/asm/may_unwind.rs +++ b/src/test/ui/asm/may_unwind.rs @@ -1,4 +1,3 @@ -// min-llvm-version: 13.0.0 // run-pass // needs-asm-support diff --git a/src/test/ui/asm/naked-functions-ffi.stderr b/src/test/ui/asm/naked-functions-ffi.stderr index ac7435513..908881b19 100644 --- a/src/test/ui/asm/naked-functions-ffi.stderr +++ b/src/test/ui/asm/naked-functions-ffi.stderr @@ -4,9 +4,9 @@ warning: `extern` fn uses type `char`, which is not FFI-safe LL | pub extern "C" fn naked(p: char) -> u128 { | ^^^^ not FFI-safe | - = note: `#[warn(improper_ctypes_definitions)]` on by default = help: consider using `u32` or `libc::wchar_t` instead = note: the `char` type has no C equivalent + = note: `#[warn(improper_ctypes_definitions)]` on by default warning: `extern` fn uses type `u128`, which is not FFI-safe --> $DIR/naked-functions-ffi.rs:9:37 diff --git a/src/test/ui/asm/naked-functions.rs b/src/test/ui/asm/naked-functions.rs index 9e626f571..2f3716ca7 100644 --- a/src/test/ui/asm/naked-functions.rs +++ b/src/test/ui/asm/naked-functions.rs @@ -4,7 +4,7 @@ // ignore-wasm32 #![feature(naked_functions)] -#![feature(asm_const, asm_sym, asm_unwind)] +#![feature(asm_const, asm_unwind)] #![crate_type = "lib"] use std::arch::asm; diff --git a/src/test/ui/asm/naked-functions.stderr b/src/test/ui/asm/naked-functions.stderr index 1828066b6..f90967fbe 100644 --- a/src/test/ui/asm/naked-functions.stderr +++ b/src/test/ui/asm/naked-functions.stderr @@ -57,13 +57,11 @@ LL | a + 1 error[E0787]: naked functions must contain a single asm block --> $DIR/naked-functions.rs:33:1 | -LL | / pub unsafe extern "C" fn inc(a: u32) -> u32 { -LL | | -LL | | a + 1 - | | ----- non-asm is unsupported in naked functions -LL | | -LL | | } - | |_^ +LL | pub unsafe extern "C" fn inc(a: u32) -> u32 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | +LL | a + 1 + | ----- non-asm is unsupported in naked functions error: referencing function parameters is not allowed in naked functions --> $DIR/naked-functions.rs:42:31 @@ -82,12 +80,11 @@ LL | asm!("/* {0} */", in(reg) a, options(noreturn)); error[E0787]: naked functions must contain a single asm block --> $DIR/naked-functions.rs:48:1 | -LL | / pub unsafe extern "C" fn inc_closure(a: u32) -> u32 { -LL | | -LL | | (|| a + 1)() - | | ------------ non-asm is unsupported in naked functions -LL | | } - | |_^ +LL | pub unsafe extern "C" fn inc_closure(a: u32) -> u32 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | +LL | (|| a + 1)() + | ------------ non-asm is unsupported in naked functions error[E0787]: only `const` and `sym` operands are supported in naked functions --> $DIR/naked-functions.rs:65:10 @@ -124,30 +121,25 @@ LL | sym G, options(noreturn), error[E0787]: naked functions must contain a single asm block --> $DIR/naked-functions.rs:54:1 | -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 | | } - | |_^ +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 error[E0787]: naked functions must contain a single asm block --> $DIR/naked-functions.rs:77:1 | -LL | / pub extern "C" fn missing_assembly() { -LL | | -LL | | } - | |_^ +LL | pub extern "C" fn missing_assembly() { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0787]: asm in naked functions must use `noreturn` option --> $DIR/naked-functions.rs:84:5 @@ -185,20 +177,17 @@ LL | asm!("", options(noreturn)); error[E0787]: naked functions must contain a single asm block --> $DIR/naked-functions.rs:82:1 | -LL | / pub extern "C" fn too_many_asm_blocks() { -LL | | -LL | | asm!(""); -LL | | -LL | | asm!(""); - | | -------- multiple asm blocks are unsupported in naked functions -LL | | -LL | | asm!(""); - | | -------- multiple asm blocks are unsupported in naked functions -LL | | -LL | | asm!("", options(noreturn)); - | | --------------------------- multiple asm blocks are unsupported in naked functions -LL | | } - | |_^ +LL | pub extern "C" fn too_many_asm_blocks() { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | asm!(""); + | -------- multiple asm blocks are unsupported in naked functions +LL | +LL | asm!(""); + | -------- multiple asm blocks are unsupported in naked functions +LL | +LL | asm!("", options(noreturn)); + | --------------------------- multiple asm blocks are unsupported in naked functions error: referencing function parameters is not allowed in naked functions --> $DIR/naked-functions.rs:97:11 @@ -211,13 +200,11 @@ LL | *&y error[E0787]: naked functions must contain a single asm block --> $DIR/naked-functions.rs:95:5 | -LL | / pub extern "C" fn inner(y: usize) -> usize { -LL | | -LL | | *&y - | | --- non-asm is unsupported in naked functions -LL | | -LL | | } - | |_____^ +LL | pub extern "C" fn inner(y: usize) -> usize { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | +LL | *&y + | --- non-asm is unsupported in naked functions error[E0787]: asm options unsupported in naked functions: `nomem`, `preserves_flags` --> $DIR/naked-functions.rs:105:5 @@ -249,18 +236,18 @@ LL | asm!("", options(noreturn, may_unwind)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: Rust ABI is unsupported in naked functions - --> $DIR/naked-functions.rs:124:15 + --> $DIR/naked-functions.rs:124: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:130:15 + --> $DIR/naked-functions.rs:130:1 | LL | pub unsafe fn rust_abi() { - | ^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^ error: naked functions cannot be inlined --> $DIR/naked-functions.rs:170:1 diff --git a/src/test/ui/asm/named-asm-labels.stderr b/src/test/ui/asm/named-asm-labels.stderr index 001601497..c8380629e 100644 --- a/src/test/ui/asm/named-asm-labels.stderr +++ b/src/test/ui/asm/named-asm-labels.stderr @@ -4,9 +4,9 @@ error: avoid using named labels in inline assembly LL | asm!("bar: nop"); | ^^^ | - = note: `#[deny(named_asm_labels)]` on by default = help: only local labels of the form `<number>:` should be used in inline asm = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information + = note: `#[deny(named_asm_labels)]` on by default error: avoid using named labels in inline assembly --> $DIR/named-asm-labels.rs:27:15 @@ -259,13 +259,13 @@ warning: avoid using named labels in inline assembly LL | asm!("warned: nop"); | ^^^^^^ | + = help: only local labels of the form `<number>:` should be used in inline asm + = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information note: the lint level is defined here --> $DIR/named-asm-labels.rs:132:16 | LL | #[warn(named_asm_labels)] | ^^^^^^^^^^^^^^^^ - = help: only local labels of the form `<number>:` should be used in inline asm - = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information error: avoid using named labels in inline assembly --> $DIR/named-asm-labels.rs:143:20 diff --git a/src/test/ui/asm/type-check-1.rs b/src/test/ui/asm/type-check-1.rs index 50b369ae0..59f7b36af 100644 --- a/src/test/ui/asm/type-check-1.rs +++ b/src/test/ui/asm/type-check-1.rs @@ -3,7 +3,7 @@ // ignore-spirv // ignore-wasm32 -#![feature(asm_const, asm_sym)] +#![feature(asm_const)] use std::arch::{asm, global_asm}; diff --git a/src/test/ui/asm/type-check-1.stderr b/src/test/ui/asm/type-check-1.stderr index 162ff1d32..184513965 100644 --- a/src/test/ui/asm/type-check-1.stderr +++ b/src/test/ui/asm/type-check-1.stderr @@ -106,7 +106,7 @@ error[E0308]: mismatched types --> $DIR/type-check-1.rs:60:26 | LL | asm!("{}", const 0 as *mut u8); - | ^^^^^^^^^^^^ expected integer, found *-ptr + | ^^^^^^^^^^^^ expected integer, found `*mut u8` | = note: expected type `{integer}` found raw pointer `*mut u8` @@ -133,7 +133,7 @@ error[E0308]: mismatched types --> $DIR/type-check-1.rs:78:25 | LL | global_asm!("{}", const 0 as *mut u8); - | ^^^^^^^^^^^^ expected integer, found *-ptr + | ^^^^^^^^^^^^ expected integer, found `*mut u8` | = note: expected type `{integer}` found raw pointer `*mut u8` diff --git a/src/test/ui/asm/unpretty-expanded.rs b/src/test/ui/asm/unpretty-expanded.rs new file mode 100644 index 000000000..25cf1c3d7 --- /dev/null +++ b/src/test/ui/asm/unpretty-expanded.rs @@ -0,0 +1,4 @@ +// needs-asm-support +// check-pass +// compile-flags: -Zunpretty=expanded +core::arch::global_asm!("x: .byte 42"); diff --git a/src/test/ui/asm/unpretty-expanded.stdout b/src/test/ui/asm/unpretty-expanded.stdout new file mode 100644 index 000000000..ab1b5f45e --- /dev/null +++ b/src/test/ui/asm/unpretty-expanded.stdout @@ -0,0 +1,10 @@ +#![feature(prelude_import)] +#![no_std] +#[prelude_import] +use ::std::prelude::rust_2015::*; +#[macro_use] +extern crate std; +// needs-asm-support +// check-pass +// compile-flags: -Zunpretty=expanded +global_asm! ("x: .byte 42"); diff --git a/src/test/ui/asm/x86_64/bad-reg.rs b/src/test/ui/asm/x86_64/bad-reg.rs index a4f50a534..f5728079a 100644 --- a/src/test/ui/asm/x86_64/bad-reg.rs +++ b/src/test/ui/asm/x86_64/bad-reg.rs @@ -1,7 +1,7 @@ // only-x86_64 // compile-flags: -C target-feature=+avx2 -#![feature(asm_const, asm_sym)] +#![feature(asm_const)] use std::arch::asm; diff --git a/src/test/ui/asm/x86_64/issue-96797.rs b/src/test/ui/asm/x86_64/issue-96797.rs index d3e0906f3..954f8c5cc 100644 --- a/src/test/ui/asm/x86_64/issue-96797.rs +++ b/src/test/ui/asm/x86_64/issue-96797.rs @@ -7,8 +7,6 @@ // regression test for #96797 -#![feature(asm_sym)] - use std::arch::global_asm; #[no_mangle] diff --git a/src/test/ui/asm/x86_64/may_unwind.rs b/src/test/ui/asm/x86_64/may_unwind.rs index 9844d63f0..c11f0938d 100644 --- a/src/test/ui/asm/x86_64/may_unwind.rs +++ b/src/test/ui/asm/x86_64/may_unwind.rs @@ -1,9 +1,9 @@ -// min-llvm-version: 13.0.0 // only-x86_64 // run-pass // needs-asm-support +// needs-unwind -#![feature(asm_sym, asm_unwind)] +#![feature(asm_unwind)] use std::arch::asm; use std::panic::{catch_unwind, resume_unwind, AssertUnwindSafe}; diff --git a/src/test/ui/asm/x86_64/multiple-clobber-abi.rs b/src/test/ui/asm/x86_64/multiple-clobber-abi.rs index 513eb270e..06589431a 100644 --- a/src/test/ui/asm/x86_64/multiple-clobber-abi.rs +++ b/src/test/ui/asm/x86_64/multiple-clobber-abi.rs @@ -4,8 +4,6 @@ // Checks that multiple clobber_abi options can be used -#![feature(asm_sym)] - use std::arch::asm; extern "sysv64" fn foo(x: i32) -> i32 { diff --git a/src/test/ui/asm/x86_64/sym.rs b/src/test/ui/asm/x86_64/sym.rs index 622365bc7..93ef4f090 100644 --- a/src/test/ui/asm/x86_64/sym.rs +++ b/src/test/ui/asm/x86_64/sym.rs @@ -1,10 +1,9 @@ -// min-llvm-version: 12.0.1 // only-x86_64 // only-linux // needs-asm-support // run-pass -#![feature(thread_local, asm_sym)] +#![feature(thread_local)] use std::arch::asm; diff --git a/src/test/ui/asm/x86_64/type-check-2.rs b/src/test/ui/asm/x86_64/type-check-2.rs index 59d8cde3f..80b29ec87 100644 --- a/src/test/ui/asm/x86_64/type-check-2.rs +++ b/src/test/ui/asm/x86_64/type-check-2.rs @@ -1,6 +1,6 @@ // only-x86_64 -#![feature(repr_simd, never_type, asm_sym)] +#![feature(repr_simd, never_type)] use std::arch::{asm, global_asm}; diff --git a/src/test/ui/asm/x86_64/type-check-3.stderr b/src/test/ui/asm/x86_64/type-check-3.stderr index b38ea8cc4..1baf50ff6 100644 --- a/src/test/ui/asm/x86_64/type-check-3.stderr +++ b/src/test/ui/asm/x86_64/type-check-3.stderr @@ -44,9 +44,9 @@ warning: formatting may not be suitable for sub-register argument LL | asm!("{0} {0}", in(reg) 0i16); | ^^^ ^^^ ---- for this argument | + = help: use `{0:x}` to have the register formatted as `ax` + = help: or use `{0:r}` to keep the default formatting of `rax` = note: `#[warn(asm_sub_register)]` on by default - = help: use the `x` modifier to have the register formatted as `ax` - = help: or use the `r` modifier to keep the default formatting of `rax` warning: formatting may not be suitable for sub-register argument --> $DIR/type-check-3.rs:36:15 @@ -54,8 +54,8 @@ warning: formatting may not be suitable for sub-register argument LL | asm!("{0} {0:x}", in(reg) 0i16); | ^^^ ---- for this argument | - = help: use the `x` modifier to have the register formatted as `ax` - = help: or use the `r` modifier to keep the default formatting of `rax` + = help: use `{0:x}` to have the register formatted as `ax` + = help: or use `{0:r}` to keep the default formatting of `rax` warning: formatting may not be suitable for sub-register argument --> $DIR/type-check-3.rs:38:15 @@ -63,8 +63,8 @@ warning: formatting may not be suitable for sub-register argument LL | asm!("{}", in(reg) 0i32); | ^^ ---- for this argument | - = 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` + = help: use `{0:e}` to have the register formatted as `eax` + = help: or use `{0:r}` to keep the default formatting of `rax` warning: formatting may not be suitable for sub-register argument --> $DIR/type-check-3.rs:41:15 @@ -72,8 +72,8 @@ warning: formatting may not be suitable for sub-register argument LL | asm!("{}", in(ymm_reg) 0i64); | ^^ ---- for this argument | - = help: use the `x` modifier to have the register formatted as `xmm0` - = help: or use the `y` modifier to keep the default formatting of `ymm0` + = help: use `{0:x}` to have the register formatted as `xmm0` + = help: or use `{0:y}` to keep the default formatting of `ymm0` error: type `i8` cannot be used with this register class --> $DIR/type-check-3.rs:52:28 diff --git a/src/test/ui/asm/x86_64/type-check-4.rs b/src/test/ui/asm/x86_64/type-check-4.rs index da3b76c3d..3d5d3807c 100644 --- a/src/test/ui/asm/x86_64/type-check-4.rs +++ b/src/test/ui/asm/x86_64/type-check-4.rs @@ -1,14 +1,13 @@ // only-x86_64 // compile-flags: -C target-feature=+avx512f -#![feature(asm_const, asm_sym)] +#![feature(asm_const)] use std::arch::{asm, global_asm}; use std::arch::x86_64::{_mm256_setzero_ps, _mm_setzero_ps}; -fn main() { -} +fn main() {} // Constants must be... constant diff --git a/src/test/ui/asm/x86_64/type-check-4.stderr b/src/test/ui/asm/x86_64/type-check-4.stderr index 33f4638fb..3875bcc21 100644 --- a/src/test/ui/asm/x86_64/type-check-4.stderr +++ b/src/test/ui/asm/x86_64/type-check-4.stderr @@ -1,5 +1,5 @@ error[E0013]: constants cannot refer to statics - --> $DIR/type-check-4.rs:22:25 + --> $DIR/type-check-4.rs:21:25 | LL | global_asm!("{}", const S); | ^ @@ -7,7 +7,7 @@ LL | global_asm!("{}", const S); = help: consider extracting the value of the `static` to a `const`, and referring to that error[E0013]: constants cannot refer to statics - --> $DIR/type-check-4.rs:25:35 + --> $DIR/type-check-4.rs:24:35 | LL | global_asm!("{}", const const_foo(S)); | ^ @@ -15,7 +15,7 @@ LL | global_asm!("{}", const const_foo(S)); = help: consider extracting the value of the `static` to a `const`, and referring to that error[E0013]: constants cannot refer to statics - --> $DIR/type-check-4.rs:28:35 + --> $DIR/type-check-4.rs:27:35 | LL | global_asm!("{}", const const_bar(S)); | ^ diff --git a/src/test/ui/asm/x86_64/type-check-5.rs b/src/test/ui/asm/x86_64/type-check-5.rs index 6190e0b52..8198df910 100644 --- a/src/test/ui/asm/x86_64/type-check-5.rs +++ b/src/test/ui/asm/x86_64/type-check-5.rs @@ -1,6 +1,6 @@ // only-x86_64 -#![feature(repr_simd, never_type, asm_sym)] +#![feature(repr_simd, never_type)] use std::arch::asm; diff --git a/src/test/ui/asm/x86_64/type-check-5.stderr b/src/test/ui/asm/x86_64/type-check-5.stderr index e9c93fea5..bd90461e5 100644 --- a/src/test/ui/asm/x86_64/type-check-5.stderr +++ b/src/test/ui/asm/x86_64/type-check-5.stderr @@ -5,6 +5,11 @@ LL | let x: u64; | - binding declared here but left uninitialized LL | asm!("{}", in(reg) x); | ^ `x` used here but it isn't initialized + | +help: consider assigning a value + | +LL | let x: u64 = 0; + | +++ error[E0381]: used binding `y` isn't initialized --> $DIR/type-check-5.rs:18:9 @@ -13,6 +18,11 @@ LL | let mut y: u64; | ----- binding declared here but left uninitialized LL | asm!("{}", inout(reg) y); | ^^^^^^^^^^^^^^^^^^^^^^^^ `y` used here but it isn't initialized + | +help: consider assigning a value + | +LL | let mut y: u64 = 0; + | +++ error[E0596]: cannot borrow `v` as mutable, as it is not declared as mutable --> $DIR/type-check-5.rs:26:29 |