diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs index c935efe71edc1..5af05fa6fe0fd 100644 --- a/compiler/rustc_driver_impl/src/lib.rs +++ b/compiler/rustc_driver_impl/src/lib.rs @@ -1344,15 +1344,17 @@ fn warn_on_confusing_output_filename_flag( || config::CG_OPTIONS.iter().any(|option| eq_ignore_separators(option.name(), filename)) || fake_args.iter().any(|arg| eq_ignore_separators(arg, filename)) { - early_dcx.early_warn( - "option `-o` has no space between flag name and value, which can be confusing", - ); - early_dcx.early_note(format!( - "output filename `-o {name}` is applied instead of a flag named `o{name}`" - )); - early_dcx.early_help(format!( - "insert a space between `-o` and `{name}` if this is intentional: `-o {name}`" - )); + early_dcx + .early_struct_warn( + "option `-o` has no space between flag name and value, which can be confusing", + ) + .with_note(format!( + "output filename `-o {name}` is applied instead of a flag named `o{name}`" + )) + .with_help(format!( + "insert a space between `-o` and `{name}` if this is intentional: `-o {name}`" + )) + .emit(); } } } diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs index 2ae9dfdc9c2ad..d19566f8f632e 100644 --- a/compiler/rustc_session/src/config.rs +++ b/compiler/rustc_session/src/config.rs @@ -3194,29 +3194,28 @@ pub mod nightly_options { if really_allows_unstable_options { continue; } - match opt.stability { - OptionStability::Unstable => { - nightly_options_on_stable += 1; - let msg = format!( - "the option `{}` is only accepted on the nightly compiler", - opt.name - ); - // The non-zero nightly_options_on_stable will force an early_fatal eventually. - let _ = early_dcx.early_err(msg); - } - OptionStability::Stable => {} - } + + nightly_options_on_stable += 1; + let msg = format!("the option `{}` is only accepted on the nightly compiler", opt.name); + // The non-zero nightly_options_on_stable will force an early_fatal eventually. + let _ = early_dcx.early_err(msg); } + if nightly_options_on_stable > 0 { - early_dcx - .early_help("consider switching to a nightly toolchain: `rustup default nightly`"); - early_dcx.early_note("selecting a toolchain with `+toolchain` arguments require a rustup proxy; see "); - early_dcx.early_note("for more information about Rust's stability policy, see "); - early_dcx.early_fatal(format!( - "{} nightly option{} were parsed", - nightly_options_on_stable, - if nightly_options_on_stable > 1 { "s" } else { "" } + let (s, were) = if nightly_options_on_stable > 1 { ("s", "were") } else { ("", "was") }; + let mut err = early_dcx.early_struct_fatal(format!( + "{nightly_options_on_stable} nightly option{s} {were} parsed", )); + err.help("consider switching to a nightly toolchain: `rustup default nightly`"); + err.note( + "selecting a toolchain with `+toolchain` arguments require a rustup proxy; \ + see ", + ); + err.note( + "for more information about Rust's stability policy, see \ + ", + ); + err.emit(); } } } diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs index 7323de9a08970..42c44b105b197 100644 --- a/compiler/rustc_session/src/session.rs +++ b/compiler/rustc_session/src/session.rs @@ -1789,14 +1789,6 @@ impl EarlyDiagCtxt { self.dcx = DiagCtxt::new(emitter); } - pub fn early_note(&self, msg: impl Into) { - self.dcx.handle().note(msg) - } - - pub fn early_help(&self, msg: impl Into) { - self.dcx.handle().struct_help(msg).emit() - } - #[must_use = "raise_fatal must be called on the returned ErrorGuaranteed in order to exit with a non-zero status code"] pub fn early_err(&self, msg: impl Into) -> ErrorGuaranteed { self.dcx.handle().err(msg) diff --git a/compiler/rustc_target/src/target_features.rs b/compiler/rustc_target/src/target_features.rs index 68ece92fbc9c0..9826633d47033 100644 --- a/compiler/rustc_target/src/target_features.rs +++ b/compiler/rustc_target/src/target_features.rs @@ -680,9 +680,9 @@ static RISCV_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[ ("a", Stable, &["zaamo", "zalrsc"]), ("b", Stable, &["zba", "zbb", "zbs"]), ("c", Stable, &["zca"]), - ("d", Unstable(sym::riscv_target_feature), &["f"]), - ("e", Unstable(sym::riscv_target_feature), &[]), - ("f", Unstable(sym::riscv_target_feature), &["zicsr"]), + ("d", Stable, &["f"]), + ("e", Unstable(sym::riscv_target_feature), &[]), // negative feature! needs special care. + ("f", Stable, &["zicsr"]), ( "forced-atomics", // Not implied by any CPU model or other feature. diff --git a/library/alloc/src/lib.rs b/library/alloc/src/lib.rs index 539bf5c532552..6bbd8e8617413 100644 --- a/library/alloc/src/lib.rs +++ b/library/alloc/src/lib.rs @@ -128,7 +128,6 @@ #![feature(derive_const)] #![feature(diagnostic_on_move)] #![feature(dispatch_from_dyn)] -#![feature(drop_guard)] #![feature(ergonomic_clones)] #![feature(error_generic_member_access)] #![feature(exact_size_is_empty)] diff --git a/library/alloctests/lib.rs b/library/alloctests/lib.rs index 77e56d3ac54f4..eca8444812521 100644 --- a/library/alloctests/lib.rs +++ b/library/alloctests/lib.rs @@ -28,7 +28,6 @@ #![feature(const_try)] #![feature(copied_into_inner)] #![feature(core_intrinsics)] -#![feature(drop_guard)] #![feature(exact_size_is_empty)] #![feature(extend_one)] #![feature(extend_one_unchecked)] diff --git a/library/core/src/mem/drop_guard.rs b/library/core/src/mem/drop_guard.rs index 8e6655f785466..31f1f93b65378 100644 --- a/library/core/src/mem/drop_guard.rs +++ b/library/core/src/mem/drop_guard.rs @@ -11,7 +11,6 @@ use crate::ops::{Deref, DerefMut}; /// /// ```rust /// # #![allow(unused)] -/// #![feature(drop_guard)] /// /// use std::mem::DropGuard; /// @@ -28,7 +27,7 @@ use crate::ops::{Deref, DerefMut}; /// // "Chashu likes tuna!!!" /// } /// ``` -#[unstable(feature = "drop_guard", issue = "144426")] +#[stable(feature = "drop_guard", since = "CURRENT_RUSTC_VERSION")] #[doc(alias = "ScopeGuard")] #[doc(alias = "defer")] pub struct DropGuard @@ -49,14 +48,14 @@ where /// /// ```rust /// # #![allow(unused)] - /// #![feature(drop_guard)] /// /// use std::mem::DropGuard; /// /// let value = String::from("Chashu likes tuna"); /// let guard = DropGuard::new(value, |s| println!("{s}")); /// ``` - #[unstable(feature = "drop_guard", issue = "144426")] + #[stable(feature = "drop_guard", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_unstable(feature = "const_drop_guard", issue = "none")] #[must_use] pub const fn new(inner: T, f: F) -> Self { Self { inner: ManuallyDrop::new(inner), f: ManuallyDrop::new(f) } @@ -73,7 +72,6 @@ where /// /// ```rust /// # #![allow(unused)] - /// #![feature(drop_guard)] /// /// use std::mem::DropGuard; /// @@ -81,7 +79,7 @@ where /// let guard = DropGuard::new(value, |s| println!("{s}")); /// assert_eq!(DropGuard::dismiss(guard), "Nori likes chicken"); /// ``` - #[unstable(feature = "drop_guard", issue = "144426")] + #[stable(feature = "drop_guard", since = "CURRENT_RUSTC_VERSION")] #[rustc_const_unstable(feature = "const_drop_guard", issue = "none")] #[inline] pub const fn dismiss(guard: Self) -> T @@ -107,7 +105,7 @@ where } } -#[unstable(feature = "drop_guard", issue = "144426")] +#[stable(feature = "drop_guard", since = "CURRENT_RUSTC_VERSION")] #[rustc_const_unstable(feature = "const_convert", issue = "143773")] const impl Deref for DropGuard where @@ -120,7 +118,7 @@ where } } -#[unstable(feature = "drop_guard", issue = "144426")] +#[stable(feature = "drop_guard", since = "CURRENT_RUSTC_VERSION")] #[rustc_const_unstable(feature = "const_convert", issue = "143773")] const impl DerefMut for DropGuard where @@ -131,7 +129,7 @@ where } } -#[unstable(feature = "drop_guard", issue = "144426")] +#[stable(feature = "drop_guard", since = "CURRENT_RUSTC_VERSION")] #[rustc_const_unstable(feature = "const_drop_guard", issue = "none")] const impl Drop for DropGuard where @@ -148,7 +146,7 @@ where } } -#[unstable(feature = "drop_guard", issue = "144426")] +#[stable(feature = "drop_guard", since = "CURRENT_RUSTC_VERSION")] impl Debug for DropGuard where T: Debug, diff --git a/library/core/src/mem/mod.rs b/library/core/src/mem/mod.rs index 26390e5071c53..64a48d7266746 100644 --- a/library/core/src/mem/mod.rs +++ b/library/core/src/mem/mod.rs @@ -59,7 +59,7 @@ mod transmutability; pub use transmutability::{Assume, TransmuteFrom}; mod drop_guard; -#[unstable(feature = "drop_guard", issue = "144426")] +#[stable(feature = "drop_guard", since = "CURRENT_RUSTC_VERSION")] pub use drop_guard::DropGuard; // This one has to be a re-export (rather than wrapping the underlying intrinsic) so that we can do diff --git a/library/core/src/slice/index.rs b/library/core/src/slice/index.rs index 47f934c37cab4..522603c574bad 100644 --- a/library/core/src/slice/index.rs +++ b/library/core/src/slice/index.rs @@ -938,7 +938,7 @@ where R: ops::RangeBounds, { let len = bounds.end; - try_into_slice_range(len, (range.start_bound().copied(), range.end_bound().copied())) + try_into_slice_range(len, (range.start_bound().copied(), range.end_bound().copied())).ok() } /// Converts a pair of `ops::Bound`s into `ops::Range` without performing any @@ -961,6 +961,24 @@ pub(crate) const fn into_range_unchecked( start..end } +#[derive(Clone, Copy)] +pub(crate) enum RangeError { + EndPastLen { end: usize }, + StartPastEnd { start: usize, end: usize }, +} + +impl RangeError { + #[cfg_attr(not(panic = "immediate-abort"), inline(never), cold)] + #[cfg_attr(panic = "immediate-abort", inline)] + #[track_caller] + const fn report(self, len: usize) -> ! { + match self { + Self::EndPastLen { end } => slice_index_fail(0, end, len), + Self::StartPastEnd { start, end } => slice_index_fail(start, end, len), + } + } +} + /// Converts pair of `ops::Bound`s into `ops::Range`. /// Returns `None` on overflowing indices. #[rustc_const_unstable(feature = "const_range", issue = "none")] @@ -968,62 +986,49 @@ pub(crate) const fn into_range_unchecked( pub(crate) const fn try_into_slice_range( len: usize, (start, end): (ops::Bound, ops::Bound), -) -> Option> { +) -> Result, RangeError> { let end = match end { - ops::Bound::Included(end) if end >= len => return None, + ops::Bound::Included(end) if end >= len => return Err(RangeError::EndPastLen { end }), // Cannot overflow because `end < len` implies `end < usize::MAX`. ops::Bound::Included(end) => end + 1, - ops::Bound::Excluded(end) if end > len => return None, + ops::Bound::Excluded(end) if end > len => return Err(RangeError::EndPastLen { end }), ops::Bound::Excluded(end) => end, ops::Bound::Unbounded => len, }; let start = match start { - ops::Bound::Excluded(start) if start >= end => return None, + ops::Bound::Excluded(start) if start >= end => { + return Err(RangeError::StartPastEnd { start, end }); + } // Cannot overflow because `start < end` implies `start < usize::MAX`. ops::Bound::Excluded(start) => start + 1, - ops::Bound::Included(start) if start > end => return None, + ops::Bound::Included(start) if start > end => { + return Err(RangeError::StartPastEnd { start, end }); + } ops::Bound::Included(start) => start, ops::Bound::Unbounded => 0, }; - Some(start..end) + Ok(start..end) } /// Converts pair of `ops::Bound`s into `ops::Range`. /// Panics on overflowing indices. #[inline] +#[track_caller] +#[rustc_const_unstable(feature = "const_range", issue = "none")] pub(crate) const fn into_slice_range( len: usize, - (start, end): (ops::Bound, ops::Bound), + bounds: (ops::Bound, ops::Bound), ) -> ops::Range { - let end = match end { - ops::Bound::Included(end) if end >= len => slice_index_fail(0, end, len), - // Cannot overflow because `end < len` implies `end < usize::MAX`. - ops::Bound::Included(end) => end + 1, - - ops::Bound::Excluded(end) if end > len => slice_index_fail(0, end, len), - ops::Bound::Excluded(end) => end, - - ops::Bound::Unbounded => len, - }; - - let start = match start { - ops::Bound::Excluded(start) if start >= end => slice_index_fail(start, end, len), - // Cannot overflow because `start < end` implies `start < usize::MAX`. - ops::Bound::Excluded(start) => start + 1, - - ops::Bound::Included(start) if start > end => slice_index_fail(start, end, len), - ops::Bound::Included(start) => start, - - ops::Bound::Unbounded => 0, - }; - - start..end + match try_into_slice_range(len, bounds) { + Ok(range) => range, + Err(e) => e.report(len), + } } #[stable(feature = "slice_index_with_ops_bound_pair", since = "1.53.0")] @@ -1032,13 +1037,13 @@ unsafe impl SliceIndex<[T]> for (ops::Bound, ops::Bound) { #[inline] fn get(self, slice: &[T]) -> Option<&Self::Output> { - try_into_slice_range(slice.len(), self)?.get(slice) + try_into_slice_range(slice.len(), self).ok()?.get(slice) } #[inline] #[rustc_no_writable] fn get_mut(self, slice: &mut [T]) -> Option<&mut Self::Output> { - try_into_slice_range(slice.len(), self)?.get_mut(slice) + try_into_slice_range(slice.len(), self).ok()?.get_mut(slice) } #[inline] diff --git a/library/core/src/str/traits.rs b/library/core/src/str/traits.rs index e4bf752ad2ae6..77fa6fcfbbb3c 100644 --- a/library/core/src/str/traits.rs +++ b/library/core/src/str/traits.rs @@ -367,12 +367,12 @@ unsafe impl SliceIndex for (ops::Bound, ops::Bound) { #[inline] fn get(self, slice: &str) -> Option<&str> { - crate::slice::index::try_into_slice_range(slice.len(), self)?.get(slice) + crate::slice::index::try_into_slice_range(slice.len(), self).ok()?.get(slice) } #[inline] fn get_mut(self, slice: &mut str) -> Option<&mut str> { - crate::slice::index::try_into_slice_range(slice.len(), self)?.get_mut(slice) + crate::slice::index::try_into_slice_range(slice.len(), self).ok()?.get_mut(slice) } #[inline] diff --git a/library/coretests/tests/lib.rs b/library/coretests/tests/lib.rs index 4cee09495de8c..69bc6edd1b833 100644 --- a/library/coretests/tests/lib.rs +++ b/library/coretests/tests/lib.rs @@ -49,7 +49,6 @@ #![feature(cstr_display)] #![feature(debug_closure_helpers)] #![feature(dec2flt)] -#![feature(drop_guard)] #![feature(duration_constants)] #![feature(duration_constructors)] #![feature(exact_div)] diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index 817d208a8a620..ef23cb402b5af 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -337,7 +337,6 @@ #![feature(cstr_display)] #![feature(cursor_split)] #![feature(derive_const)] -#![feature(drop_guard)] #![feature(duration_constants)] #![feature(error_generic_member_access)] #![feature(error_iter)] diff --git a/tests/codegen-llvm/bounds-checking/bound-tuple.rs b/tests/codegen-llvm/bounds-checking/bound-tuple.rs new file mode 100644 index 0000000000000..06decaf3960bf --- /dev/null +++ b/tests/codegen-llvm/bounds-checking/bound-tuple.rs @@ -0,0 +1,80 @@ +//@ compile-flags: -O -Zmerge-functions=disabled +#![crate_type = "lib"] + +use std::collections::Bound; +use std::ops::RangeBounds; + +#[no_mangle] +pub fn raw_index(buf: &[u8]) -> Option<&[u8]> { + // CHECK-LABEL: @raw_index( + // CHECK-NOT: slice_index_fail + // CHECK-NOT: br {{.*}} + if buf.len() < 4 { None } else { Some(&buf[4..]) } +} + +#[no_mangle] +pub fn bounds_indexer(buf: &[u8]) -> Option<&[u8]> { + // CHECK-LABEL: @bounds_indexer( + // CHECK-NOT: slice_index_fail + // CHECK-NOT: br {{.*}} + // CHECK: ret + if buf.len() < 4 { None } else { Some(&buf[(Bound::Included(4), Bound::Unbounded)]) } +} + +#[no_mangle] +pub fn bounds_indexer_with_range_bounds(buf: &[u8]) -> Option<&[u8]> { + // CHECK-LABEL: @bounds_indexer_with_range_bounds( + // CHECK-NOT: slice_index_fail + // CHECK-NOT: br {{.*}} + // CHECK: ret + fn index(buf: &[u8], range: impl RangeBounds) -> &[u8] { + &buf[(range.start_bound().map(|x| *x), range.end_bound().map(|x| *x))] + } + + if buf.len() < 4 { None } else { Some(index(buf, 4..)) } +} + +#[no_mangle] +pub fn bounds_indexer_with_range_bounds_manual_map(buf: &[u8]) -> Option<&[u8]> { + // CHECK-LABEL: @bounds_indexer_with_range_bounds_manual_map( + // CHECK-NOT: slice_index_fail + // CHECK-NOT: br {{.*}} + // CHECK: ret + fn index(buf: &[u8], range: impl RangeBounds) -> &[u8] { + &buf[( + match range.start_bound() { + Bound::Included(&i) => Bound::Included(i), + Bound::Excluded(&i) => Bound::Excluded(i), + Bound::Unbounded => Bound::Unbounded, + }, + match range.end_bound() { + Bound::Included(&i) => Bound::Included(i), + Bound::Excluded(&i) => Bound::Excluded(i), + Bound::Unbounded => Bound::Unbounded, + }, + )] + } + + if buf.len() < 4 { None } else { Some(index(buf, 4..)) } +} + +#[no_mangle] +pub fn bounds_indexer_with_range_bounds_manually_mapped(buf: &[u8]) -> Option<&[u8]> { + // CHECK-LABEL: @bounds_indexer_with_range_bounds_manually_mapped( + // CHECK-NOT: slice_index_fail + // CHECK-NOT: br {{.*}} + // CHECK: ret + fn index(buf: &[u8], range: impl RangeBounds) -> &[u8] { + &buf[match range.start_bound() { + Bound::Included(&i) => i, + Bound::Excluded(i) => i.checked_add(1).expect("overflow"), + Bound::Unbounded => 0, + }..match range.end_bound() { + Bound::Included(&i) => i, + Bound::Excluded(i) => i.checked_sub(1).expect("overflow"), + Bound::Unbounded => buf.len(), + }] + } + + if buf.len() < 4 { None } else { Some(index(buf, 4..)) } +} diff --git a/tests/codegen-llvm/bounds-check-elision-slice-min.rs b/tests/codegen-llvm/bounds-checking/slice-min.rs similarity index 100% rename from tests/codegen-llvm/bounds-check-elision-slice-min.rs rename to tests/codegen-llvm/bounds-checking/slice-min.rs diff --git a/tests/run-make/option-output-no-space/rmake.rs b/tests/run-make/option-output-no-space/rmake.rs index 2c42f15aa89a6..63d2389890155 100644 --- a/tests/run-make/option-output-no-space/rmake.rs +++ b/tests/run-make/option-output-no-space/rmake.rs @@ -14,7 +14,7 @@ fn main() { "warning: option `-o` has no space between flag name and value, which can be confusing", ) .assert_stderr_contains( - "note: output filename `-o ptimize` is applied instead of a flag named `optimize`", + "= note: output filename `-o ptimize` is applied instead of a flag named `optimize`", ); rustc() .input("main.rs") @@ -24,7 +24,7 @@ fn main() { "warning: option `-o` has no space between flag name and value, which can be confusing", ) .assert_stderr_contains( - "note: output filename `-o 0` is applied instead of a flag named `o0`", + "= note: output filename `-o 0` is applied instead of a flag named `o0`", ); rustc().input("main.rs").arg("-o1").run(); // test real args by iter optgroups @@ -36,10 +36,10 @@ fn main() { "warning: option `-o` has no space between flag name and value, which can be confusing", ) .assert_stderr_contains( - "note: output filename `-o ut-dir` is applied instead of a flag named `out-dir`", + "= note: output filename `-o ut-dir` is applied instead of a flag named `out-dir`", ) .assert_stderr_contains( - "help: insert a space between `-o` and `ut-dir` if this is intentional: `-o ut-dir`", + "= help: insert a space between `-o` and `ut-dir` if this is intentional: `-o ut-dir`", ); // test real args by iter CG_OPTIONS rustc() @@ -50,10 +50,11 @@ fn main() { "warning: option `-o` has no space between flag name and value, which can be confusing", ) .assert_stderr_contains( - "note: output filename `-o pt_level` is applied instead of a flag named `opt_level`", + "= note: output filename `-o pt_level` is applied instead of a flag named `opt_level`", ) .assert_stderr_contains( - "help: insert a space between `-o` and `pt_level` if this is intentional: `-o pt_level`" + "= help: insert a space between `-o` and `pt_level` if this is intentional: \ + `-o pt_level`", ); // separater in-sensitive rustc() @@ -64,10 +65,11 @@ fn main() { "warning: option `-o` has no space between flag name and value, which can be confusing", ) .assert_stderr_contains( - "note: output filename `-o pt-level` is applied instead of a flag named `opt-level`", + "= note: output filename `-o pt-level` is applied instead of a flag named `opt-level`", ) .assert_stderr_contains( - "help: insert a space between `-o` and `pt-level` if this is intentional: `-o pt-level`" + "= help: insert a space between `-o` and `pt-level` if this is intentional: \ + `-o pt-level`", ); rustc() .input("main.rs") @@ -77,11 +79,11 @@ fn main() { "warning: option `-o` has no space between flag name and value, which can be confusing", ) .assert_stderr_contains( - "note: output filename `-o verflow-checks` \ + "= note: output filename `-o verflow-checks` \ is applied instead of a flag named `overflow-checks`", ) .assert_stderr_contains( - "help: insert a space between `-o` and `verflow-checks` \ + "= help: insert a space between `-o` and `verflow-checks` \ if this is intentional: `-o verflow-checks`", ); diff --git a/tests/ui/bootstrap/rustc_bootstrap.force_stable.stderr b/tests/ui/bootstrap/rustc_bootstrap.force_stable.stderr index f378f3c70dd03..32f177e752ad0 100644 --- a/tests/ui/bootstrap/rustc_bootstrap.force_stable.stderr +++ b/tests/ui/bootstrap/rustc_bootstrap.force_stable.stderr @@ -1,10 +1,8 @@ error: the option `Z` is only accepted on the nightly compiler -help: consider switching to a nightly toolchain: `rustup default nightly` - -note: selecting a toolchain with `+toolchain` arguments require a rustup proxy; see - -note: for more information about Rust's stability policy, see - -error: 1 nightly option were parsed +error: 1 nightly option was parsed + | + = help: consider switching to a nightly toolchain: `rustup default nightly` + = note: selecting a toolchain with `+toolchain` arguments require a rustup proxy; see + = note: for more information about Rust's stability policy, see diff --git a/tests/ui/target-feature/abi-incompatible-target-feature-flag-enable.riscv.stderr b/tests/ui/target-feature/abi-incompatible-target-feature-flag-enable.riscv.stderr index 1995f9d993a63..bc40b139095a5 100644 --- a/tests/ui/target-feature/abi-incompatible-target-feature-flag-enable.riscv.stderr +++ b/tests/ui/target-feature/abi-incompatible-target-feature-flag-enable.riscv.stderr @@ -1,13 +1,7 @@ -warning: unstable feature specified for `-Ctarget-feature`: `d` - | - = 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 `d` 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 -warning: 2 warnings emitted +warning: 1 warning emitted diff --git a/tests/ui/target-feature/abi-incompatible-target-feature-flag-enable.rs b/tests/ui/target-feature/abi-incompatible-target-feature-flag-enable.rs index c6370f01c47d6..c6b5e15599d8e 100644 --- a/tests/ui/target-feature/abi-incompatible-target-feature-flag-enable.rs +++ b/tests/ui/target-feature/abi-incompatible-target-feature-flag-enable.rs @@ -19,5 +19,4 @@ extern crate minicore; use minicore::*; //~? WARN must be disabled to ensure that the ABI of the current target can be implemented correctly -//[riscv]~? WARN unstable feature specified for `-Ctarget-feature` //[x86]~? WARN use a soft-float target instead diff --git a/tests/ui/target-feature/abi-required-target-feature-flag-disable.riscv.stderr b/tests/ui/target-feature/abi-required-target-feature-flag-disable.riscv.stderr index c4ce26bfef8d3..e8a5e98793d10 100644 --- a/tests/ui/target-feature/abi-required-target-feature-flag-disable.riscv.stderr +++ b/tests/ui/target-feature/abi-required-target-feature-flag-disable.riscv.stderr @@ -1,13 +1,7 @@ -warning: unstable feature specified for `-Ctarget-feature`: `d` - | - = 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 `d` 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/abi-required-target-feature-flag-disable.rs b/tests/ui/target-feature/abi-required-target-feature-flag-disable.rs index 47b7abd50debb..4faef8d02d673 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,4 @@ extern crate minicore; use minicore::*; //~? WARN must be enabled to ensure that the ABI of the current target can be implemented correctly -//[x86,riscv]~? WARN unstable feature specified for `-Ctarget-feature` +//[x86]~? WARN unstable feature specified for `-Ctarget-feature`