Skip to content

Commit 43f97fb

Browse files
committed
update bootstrap configs
1 parent eae13d1 commit 43f97fb

25 files changed

+3
-95
lines changed

alloc/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,6 @@
162162
//
163163
// Language features:
164164
// tidy-alphabetical-start
165-
#![cfg_attr(bootstrap, feature(const_mut_refs))]
166-
#![cfg_attr(bootstrap, feature(const_refs_to_cell))]
167165
#![cfg_attr(not(test), feature(coroutine_trait))]
168166
#![cfg_attr(test, feature(panic_update_hook))]
169167
#![cfg_attr(test, feature(test))]

alloc/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#![feature(btree_extract_if)]
66
#![feature(cow_is_borrowed)]
77
#![feature(const_heap)]
8-
#![cfg_attr(bootstrap, feature(const_mut_refs))]
98
#![feature(const_try)]
109
#![feature(core_intrinsics)]
1110
#![feature(extract_if)]

alloc/tests/vec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1288,7 +1288,7 @@ fn test_from_iter_specialization_panic_during_iteration_drops() {
12881288
#[test]
12891289
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
12901290
// FIXME(static_mut_refs): Do not allow `static_mut_refs` lint
1291-
#[cfg_attr(not(bootstrap), allow(static_mut_refs))]
1291+
#[allow(static_mut_refs)]
12921292
fn test_from_iter_specialization_panic_during_drop_doesnt_leak() {
12931293
static mut DROP_COUNTER_OLD: [usize; 5] = [0; 5];
12941294
static mut DROP_COUNTER_NEW: [usize; 2] = [0; 2];

core/src/arch.rs

-35
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
#[allow(unused_imports)]
44
#[stable(feature = "simd_arch", since = "1.27.0")]
55
pub use crate::core_arch::arch::*;
6-
#[unstable(feature = "naked_functions", issue = "90957")]
7-
#[cfg(bootstrap)]
8-
pub use crate::naked_asm;
96

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

23-
/// Inline assembly used in combination with `#[naked]` functions.
24-
///
25-
/// Refer to [Rust By Example] for a usage guide and the [reference] for
26-
/// detailed information about the syntax and available options.
27-
///
28-
/// [Rust By Example]: https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html
29-
/// [reference]: https://doc.rust-lang.org/nightly/reference/inline-assembly.html
30-
#[unstable(feature = "naked_functions", issue = "90957")]
31-
#[macro_export]
32-
#[cfg(bootstrap)]
33-
macro_rules! naked_asm {
34-
([$last:expr], [$($pushed:expr),*]) => {
35-
#[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
36-
{
37-
core::arch::asm!($($pushed),*, options(att_syntax, noreturn))
38-
}
39-
#[cfg(not(any(target_arch = "x86_64", target_arch = "x86")))]
40-
{
41-
core::arch::asm!($($pushed),* , $last, options(noreturn))
42-
}
43-
};
44-
45-
([$first:expr $(, $rest:expr)*], [$($pushed:expr),*]) => {
46-
naked_asm!([$($rest),*], [$($pushed,)* $first]);
47-
};
48-
49-
($($expr:expr),* $(,)?) => {
50-
naked_asm!([$($expr),*], []);
51-
};
52-
}
53-
5420
/// Inline assembly used in combination with `#[naked]` functions.
5521
///
5622
/// Refer to [Rust By Example] for a usage guide and the [reference] for
@@ -60,7 +26,6 @@ macro_rules! naked_asm {
6026
/// [reference]: https://doc.rust-lang.org/nightly/reference/inline-assembly.html
6127
#[unstable(feature = "naked_functions", issue = "90957")]
6228
#[rustc_builtin_macro]
63-
#[cfg(not(bootstrap))]
6429
pub macro naked_asm("assembly template", $(operands,)* $(options($(option),*))?) {
6530
/* compiler built-in */
6631
}

core/src/array/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ pub const fn from_ref<T>(s: &T) -> &[T; 1] {
147147
/// Converts a mutable reference to `T` into a mutable reference to an array of length 1 (without copying).
148148
#[stable(feature = "array_from_ref", since = "1.53.0")]
149149
#[rustc_const_stable(feature = "const_array_from_ref", since = "1.83.0")]
150-
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
151150
pub const fn from_mut<T>(s: &mut T) -> &mut [T; 1] {
152151
// SAFETY: Converting `&mut T` to `&mut [T; 1]` is sound.
153152
unsafe { &mut *(s as *mut T).cast::<[T; 1]>() }

core/src/cell.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2181,7 +2181,6 @@ impl<T: ?Sized> UnsafeCell<T> {
21812181
/// ```
21822182
#[inline(always)]
21832183
#[stable(feature = "unsafe_cell_get_mut", since = "1.50.0")]
2184-
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
21852184
#[rustc_const_stable(feature = "const_unsafecell_get_mut", since = "1.83.0")]
21862185
pub const fn get_mut(&mut self) -> &mut T {
21872186
&mut self.value

core/src/char/methods.rs

-4
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,6 @@ impl char {
676676
#[stable(feature = "unicode_encode_char", since = "1.15.0")]
677677
#[rustc_const_stable(feature = "const_char_encode_utf8", since = "1.83.0")]
678678
#[inline]
679-
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
680679
pub const fn encode_utf8(self, dst: &mut [u8]) -> &mut str {
681680
// SAFETY: `char` is not a surrogate, so this is valid UTF-8.
682681
unsafe { from_utf8_unchecked_mut(encode_utf8_raw(self as u32, dst)) }
@@ -1284,7 +1283,6 @@ impl char {
12841283
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
12851284
#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")]
12861285
#[inline]
1287-
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
12881286
pub const fn make_ascii_uppercase(&mut self) {
12891287
*self = self.to_ascii_uppercase();
12901288
}
@@ -1311,7 +1309,6 @@ impl char {
13111309
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
13121310
#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")]
13131311
#[inline]
1314-
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
13151312
pub const fn make_ascii_lowercase(&mut self) {
13161313
*self = self.to_ascii_lowercase();
13171314
}
@@ -1777,7 +1774,6 @@ const fn len_utf16(code: u32) -> usize {
17771774
#[doc(hidden)]
17781775
#[inline]
17791776
#[rustc_allow_const_fn_unstable(const_eval_select)]
1780-
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
17811777
pub const fn encode_utf8_raw(code: u32, dst: &mut [u8]) -> &mut [u8] {
17821778
const fn panic_at_const(_code: u32, _len: usize, _dst_len: usize) {
17831779
// Note that we cannot format in constant expressions.

core/src/intrinsics.rs

-4
Original file line numberDiff line numberDiff line change
@@ -1807,7 +1807,6 @@ extern "rust-intrinsic" {
18071807
/// is selected, and that may depend on optimization level and context, for
18081808
/// example.
18091809
#[rustc_nounwind]
1810-
#[cfg(not(bootstrap))]
18111810
pub fn fmuladdf16(a: f16, b: f16, c: f16) -> f16;
18121811
/// Returns `a * b + c` for `f32` values, non-deterministically executing
18131812
/// either a fused multiply-add or two operations with rounding of the
@@ -1820,7 +1819,6 @@ extern "rust-intrinsic" {
18201819
/// is selected, and that may depend on optimization level and context, for
18211820
/// example.
18221821
#[rustc_nounwind]
1823-
#[cfg(not(bootstrap))]
18241822
pub fn fmuladdf32(a: f32, b: f32, c: f32) -> f32;
18251823
/// Returns `a * b + c` for `f64` values, non-deterministically executing
18261824
/// either a fused multiply-add or two operations with rounding of the
@@ -1833,7 +1831,6 @@ extern "rust-intrinsic" {
18331831
/// is selected, and that may depend on optimization level and context, for
18341832
/// example.
18351833
#[rustc_nounwind]
1836-
#[cfg(not(bootstrap))]
18371834
pub fn fmuladdf64(a: f64, b: f64, c: f64) -> f64;
18381835
/// Returns `a * b + c` for `f128` values, non-deterministically executing
18391836
/// either a fused multiply-add or two operations with rounding of the
@@ -1846,7 +1843,6 @@ extern "rust-intrinsic" {
18461843
/// is selected, and that may depend on optimization level and context, for
18471844
/// example.
18481845
#[rustc_nounwind]
1849-
#[cfg(not(bootstrap))]
18501846
pub fn fmuladdf128(a: f128, b: f128, c: f128) -> f128;
18511847

18521848
/// Returns the largest integer less than or equal to an `f16`.

core/src/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,6 @@
173173
//
174174
// Language features:
175175
// tidy-alphabetical-start
176-
#![cfg_attr(bootstrap, feature(const_mut_refs))]
177-
#![cfg_attr(bootstrap, feature(const_refs_to_cell))]
178-
#![cfg_attr(bootstrap, feature(const_refs_to_static))]
179176
#![feature(abi_unadjusted)]
180177
#![feature(adt_const_params)]
181178
#![feature(allow_internal_unsafe)]

core/src/mem/maybe_uninit.rs

-3
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,6 @@ impl<T> MaybeUninit<T> {
570570
/// until they are, it is advisable to avoid them.)
571571
#[stable(feature = "maybe_uninit", since = "1.36.0")]
572572
#[rustc_const_stable(feature = "const_maybe_uninit_as_mut_ptr", since = "1.83.0")]
573-
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
574573
#[inline(always)]
575574
pub const fn as_mut_ptr(&mut self) -> *mut T {
576575
// `MaybeUninit` and `ManuallyDrop` are both `repr(transparent)` so we can cast the pointer.
@@ -910,7 +909,6 @@ impl<T> MaybeUninit<T> {
910909
/// };
911910
/// ```
912911
#[stable(feature = "maybe_uninit_ref", since = "1.55.0")]
913-
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
914912
#[rustc_const_stable(
915913
feature = "const_maybe_uninit_assume_init",
916914
since = "CURRENT_RUSTC_VERSION"
@@ -1000,7 +998,6 @@ impl<T> MaybeUninit<T> {
1000998
///
1001999
/// [`assume_init_mut`]: MaybeUninit::assume_init_mut
10021000
#[unstable(feature = "maybe_uninit_slice", issue = "63569")]
1003-
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
10041001
#[rustc_const_unstable(feature = "maybe_uninit_slice", issue = "63569")]
10051002
#[inline(always)]
10061003
pub const unsafe fn slice_assume_init_mut(slice: &mut [Self]) -> &mut [T] {

core/src/mem/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,6 @@ pub fn take<T: Default>(dest: &mut T) -> T {
857857
#[inline]
858858
#[stable(feature = "rust1", since = "1.0.0")]
859859
#[must_use = "if you don't need the old value, you can just assign the new value directly"]
860-
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
861860
#[rustc_const_stable(feature = "const_replace", since = "1.83.0")]
862861
#[cfg_attr(not(test), rustc_diagnostic_item = "mem_replace")]
863862
pub const fn replace<T>(dest: &mut T, src: T) -> T {

core/src/num/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,6 @@ impl u8 {
626626
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
627627
#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")]
628628
#[inline]
629-
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
630629
pub const fn make_ascii_uppercase(&mut self) {
631630
*self = self.to_ascii_uppercase();
632631
}
@@ -653,7 +652,6 @@ impl u8 {
653652
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
654653
#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")]
655654
#[inline]
656-
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
657655
pub const fn make_ascii_lowercase(&mut self) {
658656
*self = self.to_ascii_lowercase();
659657
}

core/src/option.rs

-4
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,6 @@ impl<T> Option<T> {
723723
/// ```
724724
#[inline]
725725
#[stable(feature = "rust1", since = "1.0.0")]
726-
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
727726
#[rustc_const_stable(feature = "const_option", since = "1.83.0")]
728727
pub const fn as_mut(&mut self) -> Option<&mut T> {
729728
match *self {
@@ -1716,7 +1715,6 @@ impl<T> Option<T> {
17161715
/// ```
17171716
#[inline]
17181717
#[stable(feature = "rust1", since = "1.0.0")]
1719-
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
17201718
#[rustc_const_stable(feature = "const_option", since = "1.83.0")]
17211719
pub const fn take(&mut self) -> Option<T> {
17221720
// FIXME(const-hack) replace `mem::replace` by `mem::take` when the latter is const ready
@@ -1775,7 +1773,6 @@ impl<T> Option<T> {
17751773
/// ```
17761774
#[inline]
17771775
#[stable(feature = "option_replace", since = "1.31.0")]
1778-
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
17791776
#[rustc_const_stable(feature = "const_option", since = "1.83.0")]
17801777
pub const fn replace(&mut self, value: T) -> Option<T> {
17811778
mem::replace(self, Some(value))
@@ -1937,7 +1934,6 @@ impl<T> Option<&mut T> {
19371934
/// ```
19381935
#[must_use = "`self` will be dropped if the result is not used"]
19391936
#[stable(feature = "copied", since = "1.35.0")]
1940-
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
19411937
#[rustc_const_stable(feature = "const_option", since = "1.83.0")]
19421938
pub const fn copied(self) -> Option<T>
19431939
where

core/src/ptr/mod.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1265,7 +1265,6 @@ const unsafe fn swap_nonoverlapping_simple_untyped<T>(x: *mut T, y: *mut T, coun
12651265
/// ```
12661266
#[inline]
12671267
#[stable(feature = "rust1", since = "1.0.0")]
1268-
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
12691268
#[rustc_const_stable(feature = "const_replace", since = "1.83.0")]
12701269
#[rustc_diagnostic_item = "ptr_replace"]
12711270
pub const unsafe fn replace<T>(dst: *mut T, src: T) -> T {
@@ -1518,7 +1517,6 @@ pub const unsafe fn read<T>(src: *const T) -> T {
15181517
#[inline]
15191518
#[stable(feature = "ptr_unaligned", since = "1.17.0")]
15201519
#[rustc_const_stable(feature = "const_ptr_read", since = "1.71.0")]
1521-
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
15221520
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
15231521
#[rustc_diagnostic_item = "ptr_read_unaligned"]
15241522
pub const unsafe fn read_unaligned<T>(src: *const T) -> T {
@@ -1725,7 +1723,6 @@ pub const unsafe fn write<T>(dst: *mut T, src: T) {
17251723
/// ```
17261724
#[inline]
17271725
#[stable(feature = "ptr_unaligned", since = "1.17.0")]
1728-
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_refs_to_cell))]
17291726
#[rustc_const_stable(feature = "const_ptr_write", since = "1.83.0")]
17301727
#[rustc_diagnostic_item = "ptr_write_unaligned"]
17311728
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
@@ -1918,7 +1915,7 @@ pub unsafe fn write_volatile<T>(dst: *mut T, src: T) {
19181915
/// than trying to adapt this to accommodate that change.
19191916
///
19201917
/// Any questions go to @nagisa.
1921-
#[cfg_attr(not(bootstrap), allow(ptr_to_integer_transmute_in_consts))]
1918+
#[allow(ptr_to_integer_transmute_in_consts)]
19221919
#[lang = "align_offset"]
19231920
pub(crate) const unsafe fn align_offset<T: Sized>(p: *const T, a: usize) -> usize {
19241921
// FIXME(#75598): Direct use of these intrinsics improves codegen significantly at opt-level <=

core/src/ptr/mut_ptr.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1678,7 +1678,6 @@ impl<T: ?Sized> *mut T {
16781678
///
16791679
/// ```
16801680
/// #![feature(const_pointer_is_aligned)]
1681-
/// # #![cfg_attr(bootstrap, feature(const_mut_refs))]
16821681
///
16831682
/// // On some platforms, the alignment of primitives is less than their size.
16841683
/// #[repr(align(4))]
@@ -1804,7 +1803,6 @@ impl<T: ?Sized> *mut T {
18041803
/// ```
18051804
/// #![feature(pointer_is_aligned_to)]
18061805
/// #![feature(const_pointer_is_aligned)]
1807-
/// # #![cfg_attr(bootstrap, feature(const_mut_refs))]
18081806
///
18091807
/// // On some platforms, the alignment of i32 is less than 4.
18101808
/// #[repr(align(4))]

core/src/ptr/non_null.rs

-1
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,6 @@ impl<T: ?Sized> NonNull<T> {
394394
///
395395
/// [the module documentation]: crate::ptr#safety
396396
#[stable(feature = "nonnull", since = "1.25.0")]
397-
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
398397
#[rustc_const_stable(feature = "const_ptr_as_ref", since = "1.83.0")]
399398
#[must_use]
400399
#[inline(always)]

core/src/result.rs

-2
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,6 @@ impl<T, E> Result<T, E> {
735735
#[inline]
736736
#[stable(feature = "rust1", since = "1.0.0")]
737737
#[rustc_const_stable(feature = "const_result", since = "1.83.0")]
738-
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
739738
pub const fn as_mut(&mut self) -> Result<&mut T, &mut E> {
740739
match *self {
741740
Ok(ref mut x) => Ok(x),
@@ -1589,7 +1588,6 @@ impl<T, E> Result<&mut T, E> {
15891588
#[inline]
15901589
#[stable(feature = "result_copied", since = "1.59.0")]
15911590
#[rustc_const_stable(feature = "const_result", since = "1.83.0")]
1592-
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
15931591
#[rustc_allow_const_fn_unstable(const_precise_live_drops)]
15941592
pub const fn copied(self) -> Result<T, E>
15951593
where

core/src/slice/ascii.rs

-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ impl [u8] {
6969
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
7070
#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")]
7171
#[inline]
72-
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
7372
pub const fn make_ascii_uppercase(&mut self) {
7473
// FIXME(const-hack): We would like to simply iterate using `for` loops but this isn't currently allowed in constant expressions.
7574
let mut i = 0;
@@ -92,7 +91,6 @@ impl [u8] {
9291
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
9392
#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")]
9493
#[inline]
95-
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
9694
pub const fn make_ascii_lowercase(&mut self) {
9795
// FIXME(const-hack): We would like to simply iterate using `for` loops but this isn't currently allowed in constant expressions.
9896
let mut i = 0;

0 commit comments

Comments
 (0)