From 48b2592ad8bdbcba6a5585dd39d560bf4a2e3ca1 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 28 Sep 2026 10:31:49 +0200 Subject: [PATCH] do not complain about unstable target features on nightly --- .../rustc_codegen_ssa/src/target_features.rs | 6 +- compiler/rustc_session/src/session.rs | 4 ++ src/doc/rustc-dev-guide/src/tests/misc.md | 13 ++-- .../run-make/unstable-target-feature/rmake.rs | 20 ++++++ .../unstable-target-feature.rs | 2 + .../unstable-target-feature.stderr | 8 +++ ...cv-discoverability-guidance.riscv32.stderr | 12 +--- ...cv-discoverability-guidance.riscv64.stderr | 12 +--- .../ui/abi/riscv-discoverability-guidance.rs | 5 -- tests/ui/abi/sparcv8plus.rs | 1 - tests/ui/abi/sparcv8plus.sparc.stderr | 2 +- tests/ui/abi/sparcv8plus.sparc_cpu_v9.stderr | 2 +- ...cv8plus.sparc_cpu_v9_feature_v8plus.stderr | 10 +-- .../sparcv8plus.sparc_feature_v8plus.stderr | 10 +-- tests/ui/abi/sparcv8plus.sparcv8plus.stderr | 2 +- tests/ui/asm/hexagon-register-pairs.rs | 2 - tests/ui/asm/hexagon-register-pairs.stderr | 12 +--- tests/ui/asm/hexagon/bad-reg.rs | 2 - tests/ui/asm/hexagon/bad-reg.stderr | 64 +++++++++---------- tests/ui/asm/mips/reg-conflict.mips32.stderr | 18 +----- .../ui/asm/mips/reg-conflict.mips32r6.stderr | 18 +----- tests/ui/asm/mips/reg-conflict.mips64.stderr | 18 +----- .../ui/asm/mips/reg-conflict.mips64r6.stderr | 18 +----- tests/ui/asm/mips/reg-conflict.rs | 2 - ...-irrelevant-target-feature-flag-disable.rs | 2 - ...elevant-target-feature-flag-disable.stderr | 8 --- ...bi-required-target-feature-flag-disable.rs | 1 - ...red-target-feature-flag-disable.x86.stderr | 8 +-- .../feature-hierarchy.hexagon-hvxv66.stderr | 8 --- .../feature-hierarchy.hexagon-v60.stderr | 8 --- .../feature-hierarchy.hexagon-v68.stderr | 8 --- tests/ui/target-feature/feature-hierarchy.rs | 4 -- .../packedstack-combinations.rs | 2 - ...edstack-combinations.with_softfloat.stderr | 8 --- tests/ui/target-feature/unstable-feature.rs | 8 --- .../ui/target-feature/unstable-feature.stderr | 8 --- 36 files changed, 100 insertions(+), 236 deletions(-) create mode 100644 tests/run-make/unstable-target-feature/rmake.rs create mode 100644 tests/run-make/unstable-target-feature/unstable-target-feature.rs create mode 100644 tests/run-make/unstable-target-feature/unstable-target-feature.stderr delete mode 100644 tests/ui/target-feature/abi-irrelevant-target-feature-flag-disable.stderr delete mode 100644 tests/ui/target-feature/feature-hierarchy.hexagon-hvxv66.stderr delete mode 100644 tests/ui/target-feature/feature-hierarchy.hexagon-v60.stderr delete mode 100644 tests/ui/target-feature/feature-hierarchy.hexagon-v68.stderr delete mode 100644 tests/ui/target-feature/packedstack-combinations.with_softfloat.stderr delete mode 100644 tests/ui/target-feature/unstable-feature.rs delete mode 100644 tests/ui/target-feature/unstable-feature.stderr diff --git a/compiler/rustc_codegen_ssa/src/target_features.rs b/compiler/rustc_codegen_ssa/src/target_features.rs index b630155c144ea..301195efb9a8f 100644 --- a/compiler/rustc_codegen_ssa/src/target_features.rs +++ b/compiler/rustc_codegen_ssa/src/target_features.rs @@ -383,8 +383,10 @@ pub fn internal_target_features<'a, const N: usize>( } else { sess.dcx().emit_warn(diag); } - } else if stability.requires_nightly(/* in_cfg */ false).is_some() { - // An unstable feature. Warn about using it. It makes little sense + } else if stability.requires_nightly(/* in_cfg */ false).is_some() + && !sess.is_nightly_build() + { + // An unstable feature. Warn about using it on stable. It makes little sense // to hard-error here since we just warn about fully unknown // features above. let note = if stability.is_cfg_stable_toggle_unstable() { diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs index 060e614e82180..3180d8ca5d10c 100644 --- a/compiler/rustc_session/src/session.rs +++ b/compiler/rustc_session/src/session.rs @@ -427,6 +427,10 @@ impl EarlySession { pub fn merge_functions(&self) -> MergeFunctions { self.opts.unstable_opts.merge_functions.unwrap_or(self.target.merge_functions) } + + pub fn is_nightly_build(&self) -> bool { + self.opts.unstable_features.is_nightly_build() + } } /// Some info about the backend, returned by `CodegenBackend::init` and put into the `Session`. diff --git a/src/doc/rustc-dev-guide/src/tests/misc.md b/src/doc/rustc-dev-guide/src/tests/misc.md index 34f9faa9cc722..8fe49c82e9873 100644 --- a/src/doc/rustc-dev-guide/src/tests/misc.md +++ b/src/doc/rustc-dev-guide/src/tests/misc.md @@ -12,15 +12,10 @@ This is a bootstrap/compiler implementation detail, but it can also be useful fo This is useful because some behaviors of the compiler (e.g. diagnostics) can differ depending on whether the compiler is nightly or not. -In `ui` tests and other test suites that support `//@ rustc-env`, you can specify - -```rust,ignore -// Force unstable features to be usable on stable rustc -//@ rustc-env:RUSTC_BOOTSTRAP=1 - -// Or force nightly rustc to pretend it is a stable rustc -//@ rustc-env:RUSTC_BOOTSTRAP=-1 -``` +Note that setting `RUSTC_BOOTSTRAP` in ui tests (e.g. via `//@ rustc-env`) is pointless since ui +tests inherit the bootstrap env var from bootstrap (so it's set to `1` by default), and since +compiletest itself passes `-Z` flags (so `-1` breaks the test). To test stable-only behavior, you +need to write a `run-make` test instead. For `run-make`/`run-make-cargo` tests, `//@ rustc-env` is not supported. You can do something like the following for individual `rustc` invocations. diff --git a/tests/run-make/unstable-target-feature/rmake.rs b/tests/run-make/unstable-target-feature/rmake.rs new file mode 100644 index 0000000000000..3fefe11ff791e --- /dev/null +++ b/tests/run-make/unstable-target-feature/rmake.rs @@ -0,0 +1,20 @@ +//@ only-x86_64 +// FIXME: Once GCC backend is fixed, remove this `ignore-backends`. +//@ ignore-backends: gcc + +// Ensure that on stable we don't suggest restricting with an unsafe trait and we continue +// mentioning the rest of the obligation chain. + +use run_make_support::{diff, rustc}; + +fn main() { + let out = rustc() + .env("RUSTC_BOOTSTRAP", "-1") + .input("unstable-target-feature.rs") + .args(&["-Ctarget-feature=+x87", "--crate-type=rlib"]) + .run() + .assert_stderr_not_contains("help: consider restricting type parameter `T`") + .assert_stderr_contains("unstable feature") + .stderr_utf8(); + diff().expected_file("unstable-target-feature.stderr").actual_text("(stable rustc)", &out).run() +} diff --git a/tests/run-make/unstable-target-feature/unstable-target-feature.rs b/tests/run-make/unstable-target-feature/unstable-target-feature.rs new file mode 100644 index 0000000000000..ec7318829e77e --- /dev/null +++ b/tests/run-make/unstable-target-feature/unstable-target-feature.rs @@ -0,0 +1,2 @@ +/// Tidy is unhappy if we leave the file empty. +pub fn empty() {} diff --git a/tests/run-make/unstable-target-feature/unstable-target-feature.stderr b/tests/run-make/unstable-target-feature/unstable-target-feature.stderr new file mode 100644 index 0000000000000..e4b2717f911f3 --- /dev/null +++ b/tests/run-make/unstable-target-feature/unstable-target-feature.stderr @@ -0,0 +1,8 @@ +warning: unstable feature specified for `-Ctarget-feature`: `x87` + | + = note: this feature is not stably supported; its behavior can change in the future + = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #162235 + +warning: 1 warning emitted + diff --git a/tests/ui/abi/riscv-discoverability-guidance.riscv32.stderr b/tests/ui/abi/riscv-discoverability-guidance.riscv32.stderr index c618e5f63546a..0378b9daafe79 100644 --- a/tests/ui/abi/riscv-discoverability-guidance.riscv32.stderr +++ b/tests/ui/abi/riscv-discoverability-guidance.riscv32.stderr @@ -1,11 +1,5 @@ -warning: unstable feature specified for `-Ctarget-feature`: `unaligned-scalar-mem` - | - = note: this feature is not stably supported; its behavior can change in the future - = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #162235 - error[E0703]: invalid ABI: found `riscv-interrupt` - --> $DIR/riscv-discoverability-guidance.rs:21:8 + --> $DIR/riscv-discoverability-guidance.rs:16:8 | LL | extern "riscv-interrupt" fn isr() {} | ^^^^^^^^^^^^^^^^^ invalid ABI @@ -17,7 +11,7 @@ LL | extern "riscv-interrupt-m" fn isr() {} | ++ error[E0703]: invalid ABI: found `riscv-interrupt-u` - --> $DIR/riscv-discoverability-guidance.rs:26:8 + --> $DIR/riscv-discoverability-guidance.rs:21:8 | LL | extern "riscv-interrupt-u" fn isr_U() {} | ^^^^^^^^^^^^^^^^^^^ invalid ABI @@ -29,6 +23,6 @@ LL - extern "riscv-interrupt-u" fn isr_U() {} LL + extern "riscv-interrupt-m" fn isr_U() {} | -error: aborting due to 2 previous errors; 1 warning emitted +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0703`. diff --git a/tests/ui/abi/riscv-discoverability-guidance.riscv64.stderr b/tests/ui/abi/riscv-discoverability-guidance.riscv64.stderr index c618e5f63546a..0378b9daafe79 100644 --- a/tests/ui/abi/riscv-discoverability-guidance.riscv64.stderr +++ b/tests/ui/abi/riscv-discoverability-guidance.riscv64.stderr @@ -1,11 +1,5 @@ -warning: unstable feature specified for `-Ctarget-feature`: `unaligned-scalar-mem` - | - = note: this feature is not stably supported; its behavior can change in the future - = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #162235 - error[E0703]: invalid ABI: found `riscv-interrupt` - --> $DIR/riscv-discoverability-guidance.rs:21:8 + --> $DIR/riscv-discoverability-guidance.rs:16:8 | LL | extern "riscv-interrupt" fn isr() {} | ^^^^^^^^^^^^^^^^^ invalid ABI @@ -17,7 +11,7 @@ LL | extern "riscv-interrupt-m" fn isr() {} | ++ error[E0703]: invalid ABI: found `riscv-interrupt-u` - --> $DIR/riscv-discoverability-guidance.rs:26:8 + --> $DIR/riscv-discoverability-guidance.rs:21:8 | LL | extern "riscv-interrupt-u" fn isr_U() {} | ^^^^^^^^^^^^^^^^^^^ invalid ABI @@ -29,6 +23,6 @@ LL - extern "riscv-interrupt-u" fn isr_U() {} LL + extern "riscv-interrupt-m" fn isr_U() {} | -error: aborting due to 2 previous errors; 1 warning emitted +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0703`. diff --git a/tests/ui/abi/riscv-discoverability-guidance.rs b/tests/ui/abi/riscv-discoverability-guidance.rs index 9937c28030f89..86e34a44ec59a 100644 --- a/tests/ui/abi/riscv-discoverability-guidance.rs +++ b/tests/ui/abi/riscv-discoverability-guidance.rs @@ -10,11 +10,6 @@ #![no_core] #![feature(no_core, lang_items, abi_riscv_interrupt)] -//~? WARN unstable feature specified for `-Ctarget-feature` -//~? NOTE this feature is not stably supported; its behavior can change in the future -//~? NOTE previously accepted -//~? NOTE for more information, see issue - extern crate minicore; use minicore::*; diff --git a/tests/ui/abi/sparcv8plus.rs b/tests/ui/abi/sparcv8plus.rs index 93e8871c642ee..ec64eb414f2ec 100644 --- a/tests/ui/abi/sparcv8plus.rs +++ b/tests/ui/abi/sparcv8plus.rs @@ -12,7 +12,6 @@ //@[sparc_cpu_v9_feature_v8plus] needs-llvm-components: sparc //@ ignore-backends: gcc -//[sparc_feature_v8plus,sparc_cpu_v9_feature_v8plus]~? WARN unstable feature specified for `-Ctarget-feature` //[sparc_feature_v8plus,sparc_cpu_v9_feature_v8plus]~? WARN `v8plus` must be disabled #![crate_type = "rlib"] diff --git a/tests/ui/abi/sparcv8plus.sparc.stderr b/tests/ui/abi/sparcv8plus.sparc.stderr index 779bf597d6f66..718ff1ab0af52 100644 --- a/tests/ui/abi/sparcv8plus.sparc.stderr +++ b/tests/ui/abi/sparcv8plus.sparc.stderr @@ -1,5 +1,5 @@ error: -v8plus,-v9 - --> $DIR/sparcv8plus.rs:31:1 + --> $DIR/sparcv8plus.rs:30:1 | LL | compile_error!("-v8plus,-v9"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/abi/sparcv8plus.sparc_cpu_v9.stderr b/tests/ui/abi/sparcv8plus.sparc_cpu_v9.stderr index edf75ab70db15..5e5e108d74dfc 100644 --- a/tests/ui/abi/sparcv8plus.sparc_cpu_v9.stderr +++ b/tests/ui/abi/sparcv8plus.sparc_cpu_v9.stderr @@ -1,5 +1,5 @@ error: -v8plus,+v9 - --> $DIR/sparcv8plus.rs:44:1 + --> $DIR/sparcv8plus.rs:43:1 | LL | compile_error!("-v8plus,+v9"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/abi/sparcv8plus.sparc_cpu_v9_feature_v8plus.stderr b/tests/ui/abi/sparcv8plus.sparc_cpu_v9_feature_v8plus.stderr index 7e1d9edff230f..27545025828b5 100644 --- a/tests/ui/abi/sparcv8plus.sparc_cpu_v9_feature_v8plus.stderr +++ b/tests/ui/abi/sparcv8plus.sparc_cpu_v9_feature_v8plus.stderr @@ -1,19 +1,13 @@ -warning: unstable feature specified for `-Ctarget-feature`: `v8plus` - | - = note: this feature is not stably supported; its behavior can change in the future - = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #162235 - warning: target feature `v8plus` must be disabled to ensure that the ABI of the current target can be implemented correctly | = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #162235 error: +v8plus,+v9 - --> $DIR/sparcv8plus.rs:35:1 + --> $DIR/sparcv8plus.rs:34:1 | LL | compile_error!("+v8plus,+v9"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 1 previous error; 2 warnings emitted +error: aborting due to 1 previous error; 1 warning emitted diff --git a/tests/ui/abi/sparcv8plus.sparc_feature_v8plus.stderr b/tests/ui/abi/sparcv8plus.sparc_feature_v8plus.stderr index 3e9e7ff7c4a5c..5fdbdea580fef 100644 --- a/tests/ui/abi/sparcv8plus.sparc_feature_v8plus.stderr +++ b/tests/ui/abi/sparcv8plus.sparc_feature_v8plus.stderr @@ -1,19 +1,13 @@ -warning: unstable feature specified for `-Ctarget-feature`: `v8plus` - | - = note: this feature is not stably supported; its behavior can change in the future - = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #162235 - warning: target feature `v8plus` must be disabled to ensure that the ABI of the current target can be implemented correctly | = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #162235 error: +v8plus,-v9 (FIXME) - --> $DIR/sparcv8plus.rs:40:1 + --> $DIR/sparcv8plus.rs:39:1 | LL | compile_error!("+v8plus,-v9 (FIXME)"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 1 previous error; 2 warnings emitted +error: aborting due to 1 previous error; 1 warning emitted diff --git a/tests/ui/abi/sparcv8plus.sparcv8plus.stderr b/tests/ui/abi/sparcv8plus.sparcv8plus.stderr index 37a03abae9b4b..5e1e1fa5c798f 100644 --- a/tests/ui/abi/sparcv8plus.sparcv8plus.stderr +++ b/tests/ui/abi/sparcv8plus.sparcv8plus.stderr @@ -1,5 +1,5 @@ error: +v8plus,+v9 - --> $DIR/sparcv8plus.rs:35:1 + --> $DIR/sparcv8plus.rs:34:1 | LL | compile_error!("+v8plus,+v9"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/asm/hexagon-register-pairs.rs b/tests/ui/asm/hexagon-register-pairs.rs index 75f2960778455..e14a80355cc14 100644 --- a/tests/ui/asm/hexagon-register-pairs.rs +++ b/tests/ui/asm/hexagon-register-pairs.rs @@ -7,8 +7,6 @@ #![crate_type = "lib"] #![no_core] -//~? WARN unstable feature specified for `-Ctarget-feature`: `hvx-length128b` - extern crate minicore; use minicore::*; diff --git a/tests/ui/asm/hexagon-register-pairs.stderr b/tests/ui/asm/hexagon-register-pairs.stderr index d59d46363bdb8..6de55c34a8bc2 100644 --- a/tests/ui/asm/hexagon-register-pairs.stderr +++ b/tests/ui/asm/hexagon-register-pairs.stderr @@ -1,11 +1,5 @@ -warning: unstable feature specified for `-Ctarget-feature`: `hvx-length128b` - | - = note: this feature is not stably supported; its behavior can change in the future - = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #162235 - error: avoid using named labels in inline assembly - --> $DIR/hexagon-register-pairs.rs:32:15 + --> $DIR/hexagon-register-pairs.rs:30:15 | LL | asm!("label1: r7:6 = combine(#2, #3)"); | ^^^^^^ @@ -15,7 +9,7 @@ LL | asm!("label1: r7:6 = combine(#2, #3)"); = note: `#[deny(named_asm_labels)]` on by default error: avoid using named labels in inline assembly - --> $DIR/hexagon-register-pairs.rs:35:15 + --> $DIR/hexagon-register-pairs.rs:33:15 | LL | asm!("hexagon_label: nop"); | ^^^^^^^^^^^^^ @@ -23,5 +17,5 @@ LL | asm!("hexagon_label: nop"); = help: only local labels of the form `:` should be used in inline asm = note: see the asm section of Rust By Example for more information -error: aborting due to 2 previous errors; 1 warning emitted +error: aborting due to 2 previous errors diff --git a/tests/ui/asm/hexagon/bad-reg.rs b/tests/ui/asm/hexagon/bad-reg.rs index 6d3e1521a26cc..cbff6d3c521da 100644 --- a/tests/ui/asm/hexagon/bad-reg.rs +++ b/tests/ui/asm/hexagon/bad-reg.rs @@ -3,8 +3,6 @@ //@ needs-llvm-components: hexagon //@ ignore-backends: gcc -//~? WARN unstable feature specified for `-Ctarget-feature`: `hvx-length128b` - #![crate_type = "lib"] #![feature(no_core, asm_experimental_arch)] #![no_core] diff --git a/tests/ui/asm/hexagon/bad-reg.stderr b/tests/ui/asm/hexagon/bad-reg.stderr index ce8f46e1b8498..5fcdd03c6b93e 100644 --- a/tests/ui/asm/hexagon/bad-reg.stderr +++ b/tests/ui/asm/hexagon/bad-reg.stderr @@ -1,95 +1,89 @@ -warning: unstable feature specified for `-Ctarget-feature`: `hvx-length128b` - | - = note: this feature is not stably supported; its behavior can change in the future - = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #162235 - error: invalid register `r19`: r19 is used internally by LLVM and cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:20:18 + --> $DIR/bad-reg.rs:18:18 | LL | asm!("", out("r19") _); | ^^^^^^^^^^^^ error: invalid register `sp`: the stack pointer cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:22:18 + --> $DIR/bad-reg.rs:20:18 | LL | asm!("", out("sp") _); | ^^^^^^^^^^^ error: invalid register `r29`: the stack pointer cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:24:18 + --> $DIR/bad-reg.rs:22:18 | LL | asm!("", out("r29") _); | ^^^^^^^^^^^^ error: invalid register `r30`: the frame register cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:26:18 + --> $DIR/bad-reg.rs:24:18 | LL | asm!("", out("r30") _); | ^^^^^^^^^^^^ error: invalid register `fr`: the frame register cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:28:18 + --> $DIR/bad-reg.rs:26:18 | LL | asm!("", out("fr") _); | ^^^^^^^^^^^ error: invalid register `r31`: the link register cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:30:18 + --> $DIR/bad-reg.rs:28:18 | LL | asm!("", out("r31") _); | ^^^^^^^^^^^^ error: invalid register `lr`: the link register cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:32:18 + --> $DIR/bad-reg.rs:30:18 | LL | asm!("", out("lr") _); | ^^^^^^^^^^^ error: invalid register `r19:18`: r19 is used internally by LLVM and cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:36:18 + --> $DIR/bad-reg.rs:34:18 | LL | asm!("", out("r19:18") _); | ^^^^^^^^^^^^^^^ error: invalid register `r29:28`: the stack pointer cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:38:18 + --> $DIR/bad-reg.rs:36:18 | LL | asm!("", out("r29:28") _); | ^^^^^^^^^^^^^^^ error: invalid register `r31:30`: the frame register and link register cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:40:18 + --> $DIR/bad-reg.rs:38:18 | LL | asm!("", out("r31:30") _); | ^^^^^^^^^^^^^^^ error: register class `preg` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:45:18 + --> $DIR/bad-reg.rs:43:18 | LL | asm!("", in("p0") x); | ^^^^^^^^^^ error: register class `preg` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:48:18 + --> $DIR/bad-reg.rs:46:18 | LL | asm!("", out("p0") x); | ^^^^^^^^^^^ error: register class `qreg` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:54:18 + --> $DIR/bad-reg.rs:52:18 | LL | asm!("", in("q0") x); | ^^^^^^^^^^ error: register class `qreg` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:57:18 + --> $DIR/bad-reg.rs:55:18 | LL | asm!("", out("q0") x); | ^^^^^^^^^^^ error: register `r1:0` conflicts with register `r0` - --> $DIR/bad-reg.rs:99:31 + --> $DIR/bad-reg.rs:97:31 | LL | asm!("", out("r0") _, out("r1:0") _); | ----------- ^^^^^^^^^^^^^ register `r1:0` @@ -97,7 +91,7 @@ LL | asm!("", out("r0") _, out("r1:0") _); | register `r0` error: register `r1:0` conflicts with register `r1` - --> $DIR/bad-reg.rs:101:31 + --> $DIR/bad-reg.rs:99:31 | LL | asm!("", out("r1") _, out("r1:0") _); | ----------- ^^^^^^^^^^^^^ register `r1:0` @@ -105,7 +99,7 @@ LL | asm!("", out("r1") _, out("r1:0") _); | register `r1` error: register `v1:0` conflicts with register `v0` - --> $DIR/bad-reg.rs:105:31 + --> $DIR/bad-reg.rs:103:31 | LL | asm!("", out("v0") _, out("v1:0") _); | ----------- ^^^^^^^^^^^^^ register `v1:0` @@ -113,7 +107,7 @@ LL | asm!("", out("v0") _, out("v1:0") _); | register `v0` error: register `v1:0` conflicts with register `v1` - --> $DIR/bad-reg.rs:107:31 + --> $DIR/bad-reg.rs:105:31 | LL | asm!("", out("v1") _, out("v1:0") _); | ----------- ^^^^^^^^^^^^^ register `v1:0` @@ -121,7 +115,7 @@ LL | asm!("", out("v1") _, out("v1:0") _); | register `v1` error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:45:27 + --> $DIR/bad-reg.rs:43:27 | LL | asm!("", in("p0") x); | ^ @@ -129,7 +123,7 @@ LL | asm!("", in("p0") x); = note: register class `preg` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:48:28 + --> $DIR/bad-reg.rs:46:28 | LL | asm!("", out("p0") x); | ^ @@ -137,7 +131,7 @@ LL | asm!("", out("p0") x); = note: register class `preg` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:54:27 + --> $DIR/bad-reg.rs:52:27 | LL | asm!("", in("q0") x); | ^ @@ -145,7 +139,7 @@ LL | asm!("", in("q0") x); = note: register class `qreg` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:57:28 + --> $DIR/bad-reg.rs:55:28 | LL | asm!("", out("q0") x); | ^ @@ -153,7 +147,7 @@ LL | asm!("", out("q0") x); = note: register class `qreg` supports these types: error: type `i64` cannot be used with this register class - --> $DIR/bad-reg.rs:62:34 + --> $DIR/bad-reg.rs:60:34 | LL | asm!("/* {} */", in(reg) y); | ^ @@ -161,7 +155,7 @@ LL | asm!("/* {} */", in(reg) y); = note: register class `reg` supports these types: i8, i16, i32, f32 error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:66:39 + --> $DIR/bad-reg.rs:64:39 | LL | asm!("/* {} */", in(reg_pair) x); | ^ @@ -169,7 +163,7 @@ LL | asm!("/* {} */", in(reg_pair) x); = note: register class `reg_pair` supports these types: i64, f64 error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:70:35 + --> $DIR/bad-reg.rs:68:35 | LL | asm!("/* {} */", in(vreg) x); | ^ @@ -177,7 +171,7 @@ LL | asm!("/* {} */", in(vreg) x); = note: register class `vreg` supports these types: i32x16, i32x32 error: type `i64` cannot be used with this register class - --> $DIR/bad-reg.rs:72:35 + --> $DIR/bad-reg.rs:70:35 | LL | asm!("/* {} */", in(vreg) y); | ^ @@ -185,7 +179,7 @@ LL | asm!("/* {} */", in(vreg) y); = note: register class `vreg` supports these types: i32x16, i32x32 error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:76:40 + --> $DIR/bad-reg.rs:74:40 | LL | asm!("/* {} */", in(vreg_pair) x); | ^ @@ -193,12 +187,12 @@ LL | asm!("/* {} */", in(vreg_pair) x); = note: register class `vreg_pair` supports these types: i32x32, i32x64 error: type `i64` cannot be used with this register class - --> $DIR/bad-reg.rs:78:40 + --> $DIR/bad-reg.rs:76:40 | LL | asm!("/* {} */", in(vreg_pair) y); | ^ | = note: register class `vreg_pair` supports these types: i32x32, i32x64 -error: aborting due to 28 previous errors; 1 warning emitted +error: aborting due to 28 previous errors diff --git a/tests/ui/asm/mips/reg-conflict.mips32.stderr b/tests/ui/asm/mips/reg-conflict.mips32.stderr index 0bb1148e94bd2..7e7857662cca2 100644 --- a/tests/ui/asm/mips/reg-conflict.mips32.stderr +++ b/tests/ui/asm/mips/reg-conflict.mips32.stderr @@ -5,20 +5,8 @@ warning: unknown and unstable feature specified for `-Ctarget-feature`: `mips32r = note: for more information, see issue #162235 = help: consider filing a feature request -warning: unstable feature specified for `-Ctarget-feature`: `fp64` - | - = note: this feature is not stably supported; its behavior can change in the future - = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #162235 - -warning: unstable feature specified for `-Ctarget-feature`: `msa` - | - = note: this feature is not stably supported; its behavior can change in the future - = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #162235 - error: register `$f4` conflicts with register `$w4` - --> $DIR/reg-conflict.rs:28:33 + --> $DIR/reg-conflict.rs:26:33 | LL | asm!("", in("$w4") 0.0, in("$f4") 0.0); | ------------- ^^^^^^^^^^^^^ register `$f4` @@ -26,12 +14,12 @@ LL | asm!("", in("$w4") 0.0, in("$f4") 0.0); | register `$w4` error: register `$f25` conflicts with register `$w25` - --> $DIR/reg-conflict.rs:30:34 + --> $DIR/reg-conflict.rs:28:34 | LL | asm!("", in("$w25") 0.0, in("$f25") 0.0); | -------------- ^^^^^^^^^^^^^^ register `$f25` | | | register `$w25` -error: aborting due to 2 previous errors; 3 warnings emitted +error: aborting due to 2 previous errors; 1 warning emitted diff --git a/tests/ui/asm/mips/reg-conflict.mips32r6.stderr b/tests/ui/asm/mips/reg-conflict.mips32r6.stderr index ee8f6ee07bf8a..a2adedeef3f77 100644 --- a/tests/ui/asm/mips/reg-conflict.mips32r6.stderr +++ b/tests/ui/asm/mips/reg-conflict.mips32r6.stderr @@ -1,17 +1,5 @@ -warning: unstable feature specified for `-Ctarget-feature`: `fp64` - | - = note: this feature is not stably supported; its behavior can change in the future - = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #162235 - -warning: unstable feature specified for `-Ctarget-feature`: `msa` - | - = note: this feature is not stably supported; its behavior can change in the future - = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #162235 - error: register `$f4` conflicts with register `$w4` - --> $DIR/reg-conflict.rs:28:33 + --> $DIR/reg-conflict.rs:26:33 | LL | asm!("", in("$w4") 0.0, in("$f4") 0.0); | ------------- ^^^^^^^^^^^^^ register `$f4` @@ -19,12 +7,12 @@ LL | asm!("", in("$w4") 0.0, in("$f4") 0.0); | register `$w4` error: register `$f25` conflicts with register `$w25` - --> $DIR/reg-conflict.rs:30:34 + --> $DIR/reg-conflict.rs:28:34 | LL | asm!("", in("$w25") 0.0, in("$f25") 0.0); | -------------- ^^^^^^^^^^^^^^ register `$f25` | | | register `$w25` -error: aborting due to 2 previous errors; 2 warnings emitted +error: aborting due to 2 previous errors diff --git a/tests/ui/asm/mips/reg-conflict.mips64.stderr b/tests/ui/asm/mips/reg-conflict.mips64.stderr index 1deb3ae1a4b0d..b8cadec4d4102 100644 --- a/tests/ui/asm/mips/reg-conflict.mips64.stderr +++ b/tests/ui/asm/mips/reg-conflict.mips64.stderr @@ -5,20 +5,8 @@ warning: unknown and unstable feature specified for `-Ctarget-feature`: `mips64r = note: for more information, see issue #162235 = help: consider filing a feature request -warning: unstable feature specified for `-Ctarget-feature`: `fp64` - | - = note: this feature is not stably supported; its behavior can change in the future - = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #162235 - -warning: unstable feature specified for `-Ctarget-feature`: `msa` - | - = note: this feature is not stably supported; its behavior can change in the future - = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #162235 - error: register `$f4` conflicts with register `$w4` - --> $DIR/reg-conflict.rs:28:33 + --> $DIR/reg-conflict.rs:26:33 | LL | asm!("", in("$w4") 0.0, in("$f4") 0.0); | ------------- ^^^^^^^^^^^^^ register `$f4` @@ -26,12 +14,12 @@ LL | asm!("", in("$w4") 0.0, in("$f4") 0.0); | register `$w4` error: register `$f25` conflicts with register `$w25` - --> $DIR/reg-conflict.rs:30:34 + --> $DIR/reg-conflict.rs:28:34 | LL | asm!("", in("$w25") 0.0, in("$f25") 0.0); | -------------- ^^^^^^^^^^^^^^ register `$f25` | | | register `$w25` -error: aborting due to 2 previous errors; 3 warnings emitted +error: aborting due to 2 previous errors; 1 warning emitted diff --git a/tests/ui/asm/mips/reg-conflict.mips64r6.stderr b/tests/ui/asm/mips/reg-conflict.mips64r6.stderr index ee8f6ee07bf8a..a2adedeef3f77 100644 --- a/tests/ui/asm/mips/reg-conflict.mips64r6.stderr +++ b/tests/ui/asm/mips/reg-conflict.mips64r6.stderr @@ -1,17 +1,5 @@ -warning: unstable feature specified for `-Ctarget-feature`: `fp64` - | - = note: this feature is not stably supported; its behavior can change in the future - = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #162235 - -warning: unstable feature specified for `-Ctarget-feature`: `msa` - | - = note: this feature is not stably supported; its behavior can change in the future - = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #162235 - error: register `$f4` conflicts with register `$w4` - --> $DIR/reg-conflict.rs:28:33 + --> $DIR/reg-conflict.rs:26:33 | LL | asm!("", in("$w4") 0.0, in("$f4") 0.0); | ------------- ^^^^^^^^^^^^^ register `$f4` @@ -19,12 +7,12 @@ LL | asm!("", in("$w4") 0.0, in("$f4") 0.0); | register `$w4` error: register `$f25` conflicts with register `$w25` - --> $DIR/reg-conflict.rs:30:34 + --> $DIR/reg-conflict.rs:28:34 | LL | asm!("", in("$w25") 0.0, in("$f25") 0.0); | -------------- ^^^^^^^^^^^^^^ register `$f25` | | | register `$w25` -error: aborting due to 2 previous errors; 2 warnings emitted +error: aborting due to 2 previous errors diff --git a/tests/ui/asm/mips/reg-conflict.rs b/tests/ui/asm/mips/reg-conflict.rs index f0c9b5e6fd091..7fdf799b9d2d3 100644 --- a/tests/ui/asm/mips/reg-conflict.rs +++ b/tests/ui/asm/mips/reg-conflict.rs @@ -17,8 +17,6 @@ //[mips32]~? WARN unknown and unstable feature specified for `-Ctarget-feature`: `mips32r5` //[mips64]~? WARN unknown and unstable feature specified for `-Ctarget-feature`: `mips64r5` -//~? WARN unstable feature specified for `-Ctarget-feature`: `fp64` -//~? WARN unstable feature specified for `-Ctarget-feature`: `msa` extern crate minicore; use minicore::*; diff --git a/tests/ui/target-feature/abi-irrelevant-target-feature-flag-disable.rs b/tests/ui/target-feature/abi-irrelevant-target-feature-flag-disable.rs index 688f51dad58cb..38b35c67ba6ff 100644 --- a/tests/ui/target-feature/abi-irrelevant-target-feature-flag-disable.rs +++ b/tests/ui/target-feature/abi-irrelevant-target-feature-flag-disable.rs @@ -12,5 +12,3 @@ extern crate minicore; use minicore::*; - -//~? WARN unstable feature specified for `-Ctarget-feature`: `x87` diff --git a/tests/ui/target-feature/abi-irrelevant-target-feature-flag-disable.stderr b/tests/ui/target-feature/abi-irrelevant-target-feature-flag-disable.stderr deleted file mode 100644 index c7623519db2ed..0000000000000 --- a/tests/ui/target-feature/abi-irrelevant-target-feature-flag-disable.stderr +++ /dev/null @@ -1,8 +0,0 @@ -warning: unstable feature specified for `-Ctarget-feature`: `x87` - | - = note: this feature is not stably supported; its behavior can change in the future - = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #162235 - -warning: 1 warning emitted - diff --git a/tests/ui/target-feature/abi-required-target-feature-flag-disable.rs b/tests/ui/target-feature/abi-required-target-feature-flag-disable.rs index 4faef8d02d673..f15aa5313ba43 100644 --- a/tests/ui/target-feature/abi-required-target-feature-flag-disable.rs +++ b/tests/ui/target-feature/abi-required-target-feature-flag-disable.rs @@ -26,4 +26,3 @@ extern crate minicore; use minicore::*; //~? WARN must be enabled to ensure that the ABI of the current target can be implemented correctly -//[x86]~? WARN unstable feature specified for `-Ctarget-feature` diff --git a/tests/ui/target-feature/abi-required-target-feature-flag-disable.x86.stderr b/tests/ui/target-feature/abi-required-target-feature-flag-disable.x86.stderr index 52611d230af55..d7f4b3d670b73 100644 --- a/tests/ui/target-feature/abi-required-target-feature-flag-disable.x86.stderr +++ b/tests/ui/target-feature/abi-required-target-feature-flag-disable.x86.stderr @@ -1,13 +1,7 @@ -warning: unstable feature specified for `-Ctarget-feature`: `x87` - | - = note: this feature is not stably supported; its behavior can change in the future - = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #162235 - warning: target feature `x87` must be enabled to ensure that the ABI of the current target can be implemented correctly | = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #162235 -warning: 2 warnings emitted +warning: 1 warning emitted diff --git a/tests/ui/target-feature/feature-hierarchy.hexagon-hvxv66.stderr b/tests/ui/target-feature/feature-hierarchy.hexagon-hvxv66.stderr deleted file mode 100644 index a48e3f28bc683..0000000000000 --- a/tests/ui/target-feature/feature-hierarchy.hexagon-hvxv66.stderr +++ /dev/null @@ -1,8 +0,0 @@ -warning: unstable feature specified for `-Ctarget-feature`: `hvxv66` - | - = note: this feature is not stably supported; its behavior can change in the future - = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #162235 - -warning: 1 warning emitted - diff --git a/tests/ui/target-feature/feature-hierarchy.hexagon-v60.stderr b/tests/ui/target-feature/feature-hierarchy.hexagon-v60.stderr deleted file mode 100644 index 83ce776cb1c97..0000000000000 --- a/tests/ui/target-feature/feature-hierarchy.hexagon-v60.stderr +++ /dev/null @@ -1,8 +0,0 @@ -warning: unstable feature specified for `-Ctarget-feature`: `v60` - | - = note: this feature is not stably supported; its behavior can change in the future - = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #162235 - -warning: 1 warning emitted - diff --git a/tests/ui/target-feature/feature-hierarchy.hexagon-v68.stderr b/tests/ui/target-feature/feature-hierarchy.hexagon-v68.stderr deleted file mode 100644 index 2e62c87d7c9d8..0000000000000 --- a/tests/ui/target-feature/feature-hierarchy.hexagon-v68.stderr +++ /dev/null @@ -1,8 +0,0 @@ -warning: unstable feature specified for `-Ctarget-feature`: `v68` - | - = note: this feature is not stably supported; its behavior can change in the future - = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #162235 - -warning: 1 warning emitted - diff --git a/tests/ui/target-feature/feature-hierarchy.rs b/tests/ui/target-feature/feature-hierarchy.rs index 65f7a1e6d3db4..2629f5b000f80 100644 --- a/tests/ui/target-feature/feature-hierarchy.rs +++ b/tests/ui/target-feature/feature-hierarchy.rs @@ -63,10 +63,6 @@ fn check_sve2_includes_neon() { assert!(cfg!(target_feature = "sve2")); } -//[hexagon-v60]~? WARN unstable feature specified for `-Ctarget-feature`: `v60` -//[hexagon-v68]~? WARN unstable feature specified for `-Ctarget-feature`: `v68` -//[hexagon-hvxv66]~? WARN unstable feature specified for `-Ctarget-feature`: `hvxv66` - #[cfg(hexagon_v60)] fn check_v60_not_v68() { // Enabling v60 should not jump up the scalar feature hierarchy. diff --git a/tests/ui/target-feature/packedstack-combinations.rs b/tests/ui/target-feature/packedstack-combinations.rs index 5dc0f6adf812e..dc45ac1ff5e83 100644 --- a/tests/ui/target-feature/packedstack-combinations.rs +++ b/tests/ui/target-feature/packedstack-combinations.rs @@ -38,7 +38,5 @@ pub fn test() { } //[wrong_arch]~? ERROR `-Zpacked-stack` is only supported on s390x -//[backchain_cli]~? WARN unstable feature specified for `-Ctarget-feature`: `backchain` //[backchain_cli]~? ERROR `-Zpacked-stack` is incompatible with `backchain` target feature //[backchain_attr]~? ERROR `-Zpacked-stack` is incompatible with `backchain` target feature -//[with_softfloat]~? WARN unstable feature specified for `-Ctarget-feature`: `backchain` diff --git a/tests/ui/target-feature/packedstack-combinations.with_softfloat.stderr b/tests/ui/target-feature/packedstack-combinations.with_softfloat.stderr deleted file mode 100644 index eeec785448bc3..0000000000000 --- a/tests/ui/target-feature/packedstack-combinations.with_softfloat.stderr +++ /dev/null @@ -1,8 +0,0 @@ -warning: unstable feature specified for `-Ctarget-feature`: `backchain` - | - = note: this feature is not stably supported; its behavior can change in the future - = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #162235 - -warning: 1 warning emitted - diff --git a/tests/ui/target-feature/unstable-feature.rs b/tests/ui/target-feature/unstable-feature.rs deleted file mode 100644 index a79ad4696033a..0000000000000 --- a/tests/ui/target-feature/unstable-feature.rs +++ /dev/null @@ -1,8 +0,0 @@ -//@ compile-flags: -Ctarget-feature=+x87 --crate-type=rlib --target=x86_64-unknown-linux-gnu -//@ build-pass -//@ needs-llvm-components: x86 - -#![feature(no_core)] -#![no_core] - -//~? WARN unstable feature specified for `-Ctarget-feature`: `x87` diff --git a/tests/ui/target-feature/unstable-feature.stderr b/tests/ui/target-feature/unstable-feature.stderr deleted file mode 100644 index c7623519db2ed..0000000000000 --- a/tests/ui/target-feature/unstable-feature.stderr +++ /dev/null @@ -1,8 +0,0 @@ -warning: unstable feature specified for `-Ctarget-feature`: `x87` - | - = note: this feature is not stably supported; its behavior can change in the future - = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #162235 - -warning: 1 warning emitted -