Skip to content

Commit

Permalink
update bootstrap configs
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed Oct 16, 2024
1 parent eae13d1 commit 43f97fb
Show file tree
Hide file tree
Showing 25 changed files with 3 additions and 95 deletions.
2 changes: 0 additions & 2 deletions alloc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@
//
// Language features:
// tidy-alphabetical-start
#![cfg_attr(bootstrap, feature(const_mut_refs))]
#![cfg_attr(bootstrap, feature(const_refs_to_cell))]
#![cfg_attr(not(test), feature(coroutine_trait))]
#![cfg_attr(test, feature(panic_update_hook))]
#![cfg_attr(test, feature(test))]
Expand Down
1 change: 0 additions & 1 deletion alloc/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#![feature(btree_extract_if)]
#![feature(cow_is_borrowed)]
#![feature(const_heap)]
#![cfg_attr(bootstrap, feature(const_mut_refs))]
#![feature(const_try)]
#![feature(core_intrinsics)]
#![feature(extract_if)]
Expand Down
2 changes: 1 addition & 1 deletion alloc/tests/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,7 @@ fn test_from_iter_specialization_panic_during_iteration_drops() {
#[test]
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
// FIXME(static_mut_refs): Do not allow `static_mut_refs` lint
#[cfg_attr(not(bootstrap), allow(static_mut_refs))]
#[allow(static_mut_refs)]
fn test_from_iter_specialization_panic_during_drop_doesnt_leak() {
static mut DROP_COUNTER_OLD: [usize; 5] = [0; 5];
static mut DROP_COUNTER_NEW: [usize; 2] = [0; 2];
Expand Down
35 changes: 0 additions & 35 deletions core/src/arch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
#[allow(unused_imports)]
#[stable(feature = "simd_arch", since = "1.27.0")]
pub use crate::core_arch::arch::*;
#[unstable(feature = "naked_functions", issue = "90957")]
#[cfg(bootstrap)]
pub use crate::naked_asm;

/// Inline assembly.
///
Expand All @@ -20,37 +17,6 @@ pub macro asm("assembly template", $(operands,)* $(options($(option),*))?) {
/* compiler built-in */
}

/// Inline assembly used in combination with `#[naked]` functions.
///
/// Refer to [Rust By Example] for a usage guide and the [reference] for
/// detailed information about the syntax and available options.
///
/// [Rust By Example]: https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html
/// [reference]: https://doc.rust-lang.org/nightly/reference/inline-assembly.html
#[unstable(feature = "naked_functions", issue = "90957")]
#[macro_export]
#[cfg(bootstrap)]
macro_rules! naked_asm {
([$last:expr], [$($pushed:expr),*]) => {
#[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
{
core::arch::asm!($($pushed),*, options(att_syntax, noreturn))
}
#[cfg(not(any(target_arch = "x86_64", target_arch = "x86")))]
{
core::arch::asm!($($pushed),* , $last, options(noreturn))
}
};

([$first:expr $(, $rest:expr)*], [$($pushed:expr),*]) => {
naked_asm!([$($rest),*], [$($pushed,)* $first]);
};

($($expr:expr),* $(,)?) => {
naked_asm!([$($expr),*], []);
};
}

/// Inline assembly used in combination with `#[naked]` functions.
///
/// Refer to [Rust By Example] for a usage guide and the [reference] for
Expand All @@ -60,7 +26,6 @@ macro_rules! naked_asm {
/// [reference]: https://doc.rust-lang.org/nightly/reference/inline-assembly.html
#[unstable(feature = "naked_functions", issue = "90957")]
#[rustc_builtin_macro]
#[cfg(not(bootstrap))]
pub macro naked_asm("assembly template", $(operands,)* $(options($(option),*))?) {
/* compiler built-in */
}
Expand Down
1 change: 0 additions & 1 deletion core/src/array/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ pub const fn from_ref<T>(s: &T) -> &[T; 1] {
/// Converts a mutable reference to `T` into a mutable reference to an array of length 1 (without copying).
#[stable(feature = "array_from_ref", since = "1.53.0")]
#[rustc_const_stable(feature = "const_array_from_ref", since = "1.83.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
pub const fn from_mut<T>(s: &mut T) -> &mut [T; 1] {
// SAFETY: Converting `&mut T` to `&mut [T; 1]` is sound.
unsafe { &mut *(s as *mut T).cast::<[T; 1]>() }
Expand Down
1 change: 0 additions & 1 deletion core/src/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2181,7 +2181,6 @@ impl<T: ?Sized> UnsafeCell<T> {
/// ```
#[inline(always)]
#[stable(feature = "unsafe_cell_get_mut", since = "1.50.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[rustc_const_stable(feature = "const_unsafecell_get_mut", since = "1.83.0")]
pub const fn get_mut(&mut self) -> &mut T {
&mut self.value
Expand Down
4 changes: 0 additions & 4 deletions core/src/char/methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,6 @@ impl char {
#[stable(feature = "unicode_encode_char", since = "1.15.0")]
#[rustc_const_stable(feature = "const_char_encode_utf8", since = "1.83.0")]
#[inline]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
pub const fn encode_utf8(self, dst: &mut [u8]) -> &mut str {
// SAFETY: `char` is not a surrogate, so this is valid UTF-8.
unsafe { from_utf8_unchecked_mut(encode_utf8_raw(self as u32, dst)) }
Expand Down Expand Up @@ -1284,7 +1283,6 @@ impl char {
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")]
#[inline]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
pub const fn make_ascii_uppercase(&mut self) {
*self = self.to_ascii_uppercase();
}
Expand All @@ -1311,7 +1309,6 @@ impl char {
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")]
#[inline]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
pub const fn make_ascii_lowercase(&mut self) {
*self = self.to_ascii_lowercase();
}
Expand Down Expand Up @@ -1777,7 +1774,6 @@ const fn len_utf16(code: u32) -> usize {
#[doc(hidden)]
#[inline]
#[rustc_allow_const_fn_unstable(const_eval_select)]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
pub const fn encode_utf8_raw(code: u32, dst: &mut [u8]) -> &mut [u8] {
const fn panic_at_const(_code: u32, _len: usize, _dst_len: usize) {
// Note that we cannot format in constant expressions.
Expand Down
4 changes: 0 additions & 4 deletions core/src/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1807,7 +1807,6 @@ extern "rust-intrinsic" {
/// is selected, and that may depend on optimization level and context, for
/// example.
#[rustc_nounwind]
#[cfg(not(bootstrap))]
pub fn fmuladdf16(a: f16, b: f16, c: f16) -> f16;
/// Returns `a * b + c` for `f32` values, non-deterministically executing
/// either a fused multiply-add or two operations with rounding of the
Expand All @@ -1820,7 +1819,6 @@ extern "rust-intrinsic" {
/// is selected, and that may depend on optimization level and context, for
/// example.
#[rustc_nounwind]
#[cfg(not(bootstrap))]
pub fn fmuladdf32(a: f32, b: f32, c: f32) -> f32;
/// Returns `a * b + c` for `f64` values, non-deterministically executing
/// either a fused multiply-add or two operations with rounding of the
Expand All @@ -1833,7 +1831,6 @@ extern "rust-intrinsic" {
/// is selected, and that may depend on optimization level and context, for
/// example.
#[rustc_nounwind]
#[cfg(not(bootstrap))]
pub fn fmuladdf64(a: f64, b: f64, c: f64) -> f64;
/// Returns `a * b + c` for `f128` values, non-deterministically executing
/// either a fused multiply-add or two operations with rounding of the
Expand All @@ -1846,7 +1843,6 @@ extern "rust-intrinsic" {
/// is selected, and that may depend on optimization level and context, for
/// example.
#[rustc_nounwind]
#[cfg(not(bootstrap))]
pub fn fmuladdf128(a: f128, b: f128, c: f128) -> f128;

/// Returns the largest integer less than or equal to an `f16`.
Expand Down
3 changes: 0 additions & 3 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,6 @@
//
// Language features:
// tidy-alphabetical-start
#![cfg_attr(bootstrap, feature(const_mut_refs))]
#![cfg_attr(bootstrap, feature(const_refs_to_cell))]
#![cfg_attr(bootstrap, feature(const_refs_to_static))]
#![feature(abi_unadjusted)]
#![feature(adt_const_params)]
#![feature(allow_internal_unsafe)]
Expand Down
3 changes: 0 additions & 3 deletions core/src/mem/maybe_uninit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,6 @@ impl<T> MaybeUninit<T> {
/// until they are, it is advisable to avoid them.)
#[stable(feature = "maybe_uninit", since = "1.36.0")]
#[rustc_const_stable(feature = "const_maybe_uninit_as_mut_ptr", since = "1.83.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[inline(always)]
pub const fn as_mut_ptr(&mut self) -> *mut T {
// `MaybeUninit` and `ManuallyDrop` are both `repr(transparent)` so we can cast the pointer.
Expand Down Expand Up @@ -910,7 +909,6 @@ impl<T> MaybeUninit<T> {
/// };
/// ```
#[stable(feature = "maybe_uninit_ref", since = "1.55.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[rustc_const_stable(
feature = "const_maybe_uninit_assume_init",
since = "CURRENT_RUSTC_VERSION"
Expand Down Expand Up @@ -1000,7 +998,6 @@ impl<T> MaybeUninit<T> {
///
/// [`assume_init_mut`]: MaybeUninit::assume_init_mut
#[unstable(feature = "maybe_uninit_slice", issue = "63569")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[rustc_const_unstable(feature = "maybe_uninit_slice", issue = "63569")]
#[inline(always)]
pub const unsafe fn slice_assume_init_mut(slice: &mut [Self]) -> &mut [T] {
Expand Down
1 change: 0 additions & 1 deletion core/src/mem/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,6 @@ pub fn take<T: Default>(dest: &mut T) -> T {
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[must_use = "if you don't need the old value, you can just assign the new value directly"]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[rustc_const_stable(feature = "const_replace", since = "1.83.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "mem_replace")]
pub const fn replace<T>(dest: &mut T, src: T) -> T {
Expand Down
2 changes: 0 additions & 2 deletions core/src/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,6 @@ impl u8 {
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")]
#[inline]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
pub const fn make_ascii_uppercase(&mut self) {
*self = self.to_ascii_uppercase();
}
Expand All @@ -653,7 +652,6 @@ impl u8 {
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")]
#[inline]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
pub const fn make_ascii_lowercase(&mut self) {
*self = self.to_ascii_lowercase();
}
Expand Down
4 changes: 0 additions & 4 deletions core/src/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,6 @@ impl<T> Option<T> {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[rustc_const_stable(feature = "const_option", since = "1.83.0")]
pub const fn as_mut(&mut self) -> Option<&mut T> {
match *self {
Expand Down Expand Up @@ -1716,7 +1715,6 @@ impl<T> Option<T> {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[rustc_const_stable(feature = "const_option", since = "1.83.0")]
pub const fn take(&mut self) -> Option<T> {
// FIXME(const-hack) replace `mem::replace` by `mem::take` when the latter is const ready
Expand Down Expand Up @@ -1775,7 +1773,6 @@ impl<T> Option<T> {
/// ```
#[inline]
#[stable(feature = "option_replace", since = "1.31.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[rustc_const_stable(feature = "const_option", since = "1.83.0")]
pub const fn replace(&mut self, value: T) -> Option<T> {
mem::replace(self, Some(value))
Expand Down Expand Up @@ -1937,7 +1934,6 @@ impl<T> Option<&mut T> {
/// ```
#[must_use = "`self` will be dropped if the result is not used"]
#[stable(feature = "copied", since = "1.35.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[rustc_const_stable(feature = "const_option", since = "1.83.0")]
pub const fn copied(self) -> Option<T>
where
Expand Down
5 changes: 1 addition & 4 deletions core/src/ptr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,6 @@ const unsafe fn swap_nonoverlapping_simple_untyped<T>(x: *mut T, y: *mut T, coun
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[rustc_const_stable(feature = "const_replace", since = "1.83.0")]
#[rustc_diagnostic_item = "ptr_replace"]
pub const unsafe fn replace<T>(dst: *mut T, src: T) -> T {
Expand Down Expand Up @@ -1518,7 +1517,6 @@ pub const unsafe fn read<T>(src: *const T) -> T {
#[inline]
#[stable(feature = "ptr_unaligned", since = "1.17.0")]
#[rustc_const_stable(feature = "const_ptr_read", since = "1.71.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
#[rustc_diagnostic_item = "ptr_read_unaligned"]
pub const unsafe fn read_unaligned<T>(src: *const T) -> T {
Expand Down Expand Up @@ -1725,7 +1723,6 @@ pub const unsafe fn write<T>(dst: *mut T, src: T) {
/// ```
#[inline]
#[stable(feature = "ptr_unaligned", since = "1.17.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_refs_to_cell))]
#[rustc_const_stable(feature = "const_ptr_write", since = "1.83.0")]
#[rustc_diagnostic_item = "ptr_write_unaligned"]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
Expand Down Expand Up @@ -1918,7 +1915,7 @@ pub unsafe fn write_volatile<T>(dst: *mut T, src: T) {
/// than trying to adapt this to accommodate that change.
///
/// Any questions go to @nagisa.
#[cfg_attr(not(bootstrap), allow(ptr_to_integer_transmute_in_consts))]
#[allow(ptr_to_integer_transmute_in_consts)]
#[lang = "align_offset"]
pub(crate) const unsafe fn align_offset<T: Sized>(p: *const T, a: usize) -> usize {
// FIXME(#75598): Direct use of these intrinsics improves codegen significantly at opt-level <=
Expand Down
2 changes: 0 additions & 2 deletions core/src/ptr/mut_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1678,7 +1678,6 @@ impl<T: ?Sized> *mut T {
///
/// ```
/// #![feature(const_pointer_is_aligned)]
/// # #![cfg_attr(bootstrap, feature(const_mut_refs))]
///
/// // On some platforms, the alignment of primitives is less than their size.
/// #[repr(align(4))]
Expand Down Expand Up @@ -1804,7 +1803,6 @@ impl<T: ?Sized> *mut T {
/// ```
/// #![feature(pointer_is_aligned_to)]
/// #![feature(const_pointer_is_aligned)]
/// # #![cfg_attr(bootstrap, feature(const_mut_refs))]
///
/// // On some platforms, the alignment of i32 is less than 4.
/// #[repr(align(4))]
Expand Down
1 change: 0 additions & 1 deletion core/src/ptr/non_null.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,6 @@ impl<T: ?Sized> NonNull<T> {
///
/// [the module documentation]: crate::ptr#safety
#[stable(feature = "nonnull", since = "1.25.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[rustc_const_stable(feature = "const_ptr_as_ref", since = "1.83.0")]
#[must_use]
#[inline(always)]
Expand Down
2 changes: 0 additions & 2 deletions core/src/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,6 @@ impl<T, E> Result<T, E> {
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "const_result", since = "1.83.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
pub const fn as_mut(&mut self) -> Result<&mut T, &mut E> {
match *self {
Ok(ref mut x) => Ok(x),
Expand Down Expand Up @@ -1589,7 +1588,6 @@ impl<T, E> Result<&mut T, E> {
#[inline]
#[stable(feature = "result_copied", since = "1.59.0")]
#[rustc_const_stable(feature = "const_result", since = "1.83.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[rustc_allow_const_fn_unstable(const_precise_live_drops)]
pub const fn copied(self) -> Result<T, E>
where
Expand Down
2 changes: 0 additions & 2 deletions core/src/slice/ascii.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ impl [u8] {
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")]
#[inline]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
pub const fn make_ascii_uppercase(&mut self) {
// FIXME(const-hack): We would like to simply iterate using `for` loops but this isn't currently allowed in constant expressions.
let mut i = 0;
Expand All @@ -92,7 +91,6 @@ impl [u8] {
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")]
#[inline]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
pub const fn make_ascii_lowercase(&mut self) {
// FIXME(const-hack): We would like to simply iterate using `for` loops but this isn't currently allowed in constant expressions.
let mut i = 0;
Expand Down
Loading

0 comments on commit 43f97fb

Please sign in to comment.