Skip to content

Commit 6852fd4

Browse files
committed
update cfgs
1 parent be78dab commit 6852fd4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+107
-352
lines changed

compiler/rustc_builtin_macros/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
#![allow(internal_features)]
66
#![allow(rustc::diagnostic_outside_of_impl)]
77
#![allow(rustc::untranslatable_diagnostic)]
8-
#![cfg_attr(not(bootstrap), feature(autodiff))]
98
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
109
#![doc(rust_logo)]
1110
#![feature(assert_matches)]
11+
#![feature(autodiff)]
1212
#![feature(box_patterns)]
1313
#![feature(decl_macro)]
1414
#![feature(if_let_guard)]

library/alloc/benches/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
#![feature(iter_next_chunk)]
55
#![feature(repr_simd)]
66
#![feature(slice_partition_dedup)]
7-
#![cfg_attr(bootstrap, feature(strict_provenance))]
8-
#![cfg_attr(not(bootstrap), feature(strict_provenance_lints))]
7+
#![feature(strict_provenance_lints)]
98
#![feature(test)]
109
#![deny(fuzzy_provenance_casts)]
1110

library/alloc/src/boxed.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,7 @@ use core::error::{self, Error};
191191
use core::fmt;
192192
use core::future::Future;
193193
use core::hash::{Hash, Hasher};
194-
#[cfg(not(bootstrap))]
195-
use core::marker::PointerLike;
196-
use core::marker::{Tuple, Unsize};
194+
use core::marker::{PointerLike, Tuple, Unsize};
197195
use core::mem::{self, SizedTypeProperties};
198196
use core::ops::{
199197
AsyncFn, AsyncFnMut, AsyncFnOnce, CoerceUnsized, Coroutine, CoroutineState, Deref, DerefMut,
@@ -227,7 +225,7 @@ pub use thin::ThinBox;
227225
#[fundamental]
228226
#[stable(feature = "rust1", since = "1.0.0")]
229227
#[rustc_insignificant_dtor]
230-
#[cfg_attr(not(bootstrap), doc(search_unbox))]
228+
#[doc(search_unbox)]
231229
// The declaration of the `Box` struct must be kept in sync with the
232230
// compiler or ICEs will happen.
233231
pub struct Box<
@@ -1502,7 +1500,7 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
15021500
/// [`as_ptr`]: Self::as_ptr
15031501
#[unstable(feature = "box_as_ptr", issue = "129090")]
15041502
#[rustc_never_returns_null_ptr]
1505-
#[cfg_attr(not(bootstrap), rustc_as_ptr)]
1503+
#[rustc_as_ptr]
15061504
#[inline]
15071505
pub fn as_mut_ptr(b: &mut Self) -> *mut T {
15081506
// This is a primitive deref, not going through `DerefMut`, and therefore not materializing
@@ -1551,7 +1549,7 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
15511549
/// [`as_ptr`]: Self::as_ptr
15521550
#[unstable(feature = "box_as_ptr", issue = "129090")]
15531551
#[rustc_never_returns_null_ptr]
1554-
#[cfg_attr(not(bootstrap), rustc_as_ptr)]
1552+
#[rustc_as_ptr]
15551553
#[inline]
15561554
pub fn as_ptr(b: &Self) -> *const T {
15571555
// This is a primitive deref, not going through `DerefMut`, and therefore not materializing
@@ -2134,6 +2132,5 @@ impl<E: Error> Error for Box<E> {
21342132
}
21352133
}
21362134

2137-
#[cfg(not(bootstrap))]
21382135
#[unstable(feature = "pointer_like_trait", issue = "none")]
21392136
impl<T> PointerLike for Box<T> {}

library/alloc/src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,6 @@
163163
//
164164
// Language features:
165165
// tidy-alphabetical-start
166-
#![cfg_attr(bootstrap, feature(strict_provenance))]
167-
#![cfg_attr(not(bootstrap), feature(strict_provenance_lints))]
168166
#![cfg_attr(not(test), feature(coroutine_trait))]
169167
#![cfg_attr(test, feature(panic_update_hook))]
170168
#![cfg_attr(test, feature(test))]
@@ -188,6 +186,7 @@
188186
#![feature(slice_internals)]
189187
#![feature(staged_api)]
190188
#![feature(stmt_expr_attributes)]
189+
#![feature(strict_provenance_lints)]
191190
#![feature(unboxed_closures)]
192191
#![feature(unsized_fn_params)]
193192
#![feature(with_negative_coherence)]

library/alloc/src/raw_vec.rs

-3
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ impl<T> RawVec<T, Global> {
103103
/// `RawVec` with capacity `usize::MAX`. Useful for implementing
104104
/// delayed allocation.
105105
#[must_use]
106-
#[cfg_attr(bootstrap, rustc_const_stable(feature = "raw_vec_internals_const", since = "1.81"))]
107106
pub const fn new() -> Self {
108107
Self::new_in(Global)
109108
}
@@ -179,7 +178,6 @@ impl<T, A: Allocator> RawVec<T, A> {
179178
/// Like `new`, but parameterized over the choice of allocator for
180179
/// the returned `RawVec`.
181180
#[inline]
182-
#[cfg_attr(bootstrap, rustc_const_stable(feature = "raw_vec_internals_const", since = "1.81"))]
183181
pub const fn new_in(alloc: A) -> Self {
184182
Self { inner: RawVecInner::new_in(alloc, align_of::<T>()), _marker: PhantomData }
185183
}
@@ -409,7 +407,6 @@ unsafe impl<#[may_dangle] T, A: Allocator> Drop for RawVec<T, A> {
409407

410408
impl<A: Allocator> RawVecInner<A> {
411409
#[inline]
412-
#[cfg_attr(bootstrap, rustc_const_stable(feature = "raw_vec_internals_const", since = "1.81"))]
413410
const fn new_in(alloc: A, align: usize) -> Self {
414411
let ptr = unsafe { core::mem::transmute(align) };
415412
// `cap: 0` means "unallocated". zero-sized types are ignored.

library/alloc/src/rc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ fn rc_inner_layout_for_value_layout(layout: Layout) -> Layout {
307307
/// `value.get_mut()`. This avoids conflicts with methods of the inner type `T`.
308308
///
309309
/// [get_mut]: Rc::get_mut
310-
#[cfg_attr(not(bootstrap), doc(search_unbox))]
310+
#[doc(search_unbox)]
311311
#[cfg_attr(not(test), rustc_diagnostic_item = "Rc")]
312312
#[stable(feature = "rust1", since = "1.0.0")]
313313
#[rustc_insignificant_dtor]

library/alloc/src/sync.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ macro_rules! acquire {
235235
/// counting in general.
236236
///
237237
/// [rc_examples]: crate::rc#examples
238-
#[cfg_attr(not(bootstrap), doc(search_unbox))]
238+
#[doc(search_unbox)]
239239
#[cfg_attr(not(test), rustc_diagnostic_item = "Arc")]
240240
#[stable(feature = "rust1", since = "1.0.0")]
241241
#[rustc_insignificant_dtor]

library/alloc/src/vec/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1662,7 +1662,7 @@ impl<T, A: Allocator> Vec<T, A> {
16621662
#[stable(feature = "vec_as_ptr", since = "1.37.0")]
16631663
#[rustc_const_unstable(feature = "const_vec_string_slice", issue = "129041")]
16641664
#[rustc_never_returns_null_ptr]
1665-
#[cfg_attr(not(bootstrap), rustc_as_ptr)]
1665+
#[rustc_as_ptr]
16661666
#[inline]
16671667
pub const fn as_ptr(&self) -> *const T {
16681668
// We shadow the slice method of the same name to avoid going through
@@ -1725,7 +1725,7 @@ impl<T, A: Allocator> Vec<T, A> {
17251725
#[stable(feature = "vec_as_ptr", since = "1.37.0")]
17261726
#[rustc_const_unstable(feature = "const_vec_string_slice", issue = "129041")]
17271727
#[rustc_never_returns_null_ptr]
1728-
#[cfg_attr(not(bootstrap), rustc_as_ptr)]
1728+
#[rustc_as_ptr]
17291729
#[inline]
17301730
pub const fn as_mut_ptr(&mut self) -> *mut T {
17311731
// We shadow the slice method of the same name to avoid going through

library/alloc/tests/boxed.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use core::mem::MaybeUninit;
44
use core::ptr::NonNull;
55

66
#[test]
7-
#[cfg_attr(not(bootstrap), expect(dangling_pointers_from_temporaries))]
7+
#[expect(dangling_pointers_from_temporaries)]
88
fn uninitialized_zero_size_box() {
99
assert_eq!(
1010
&*Box::<()>::new_uninit() as *const _,

library/alloc/tests/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@
3232
#![feature(panic_update_hook)]
3333
#![feature(pointer_is_aligned_to)]
3434
#![feature(thin_box)]
35-
#![cfg_attr(bootstrap, feature(strict_provenance))]
36-
#![cfg_attr(not(bootstrap), feature(strict_provenance_lints))]
3735
#![feature(drain_keep_rest)]
3836
#![feature(local_waker)]
37+
#![feature(strict_provenance_lints)]
3938
#![feature(vec_pop_if)]
4039
#![feature(unique_rc_arc)]
4140
#![feature(macro_metavar_expr_concat)]

library/core/Cargo.toml

-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ check-cfg = [
4343
'cfg(bootstrap)',
4444
'cfg(no_fp_fmt_parse)',
4545
'cfg(stdarch_intel_sde)',
46-
# #[cfg(bootstrap)] rtems
47-
'cfg(target_os, values("rtems"))',
4846
# core use #[path] imports to portable-simd `core_simd` crate
4947
# and to stdarch `core_arch` crate which messes-up with Cargo list
5048
# of declared features, we therefor expect any feature cfg

library/core/src/alloc/layout.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ impl Layout {
157157
#[must_use = "this returns the minimum alignment, \
158158
without modifying the layout"]
159159
#[inline]
160-
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(ptr_alignment_type))]
161160
pub const fn align(&self) -> usize {
162161
self.align.as_usize()
163162
}
@@ -255,7 +254,7 @@ impl Layout {
255254
/// `align` violates the conditions listed in [`Layout::from_size_align`].
256255
#[stable(feature = "alloc_layout_manipulation", since = "1.44.0")]
257256
#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
258-
#[cfg_attr(not(bootstrap), rustc_const_stable_indirect)]
257+
#[rustc_const_stable_indirect]
259258
#[inline]
260259
pub const fn align_to(&self, align: usize) -> Result<Self, LayoutError> {
261260
if let Some(align) = Alignment::new(align) {
@@ -331,7 +330,7 @@ impl Layout {
331330
/// to the layout's current size.
332331
#[stable(feature = "alloc_layout_manipulation", since = "1.44.0")]
333332
#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
334-
#[cfg_attr(not(bootstrap), rustc_const_stable_indirect)]
333+
#[rustc_const_stable_indirect]
335334
#[must_use = "this returns a new `Layout`, \
336335
without modifying the original"]
337336
#[inline]
@@ -431,7 +430,7 @@ impl Layout {
431430
/// ```
432431
#[stable(feature = "alloc_layout_manipulation", since = "1.44.0")]
433432
#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
434-
#[cfg_attr(not(bootstrap), rustc_const_stable_indirect)]
433+
#[rustc_const_stable_indirect]
435434
#[inline]
436435
pub const fn extend(&self, next: Self) -> Result<(Self, usize), LayoutError> {
437436
let new_align = Alignment::max(self.align, next.align);
@@ -495,7 +494,7 @@ impl Layout {
495494
/// `isize::MAX`, returns `LayoutError`.
496495
#[stable(feature = "alloc_layout_manipulation", since = "1.44.0")]
497496
#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
498-
#[cfg_attr(not(bootstrap), rustc_const_stable_indirect)]
497+
#[rustc_const_stable_indirect]
499498
#[inline]
500499
pub const fn array<T>(n: usize) -> Result<Self, LayoutError> {
501500
// Reduce the amount of code we need to monomorphize per `T`.

library/core/src/cell.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ impl<T: ?Sized> Cell<T> {
587587
#[inline]
588588
#[stable(feature = "cell_as_ptr", since = "1.12.0")]
589589
#[rustc_const_stable(feature = "const_cell_as_ptr", since = "1.32.0")]
590-
#[cfg_attr(not(bootstrap), rustc_as_ptr)]
590+
#[rustc_as_ptr]
591591
#[rustc_never_returns_null_ptr]
592592
pub const fn as_ptr(&self) -> *mut T {
593593
self.value.get()
@@ -1150,7 +1150,7 @@ impl<T: ?Sized> RefCell<T> {
11501150
/// ```
11511151
#[inline]
11521152
#[stable(feature = "cell_as_ptr", since = "1.12.0")]
1153-
#[cfg_attr(not(bootstrap), rustc_as_ptr)]
1153+
#[rustc_as_ptr]
11541154
#[rustc_never_returns_null_ptr]
11551155
pub fn as_ptr(&self) -> *mut T {
11561156
self.value.get()
@@ -2135,7 +2135,6 @@ impl<T: ?Sized> UnsafeCell<T> {
21352135
#[inline(always)]
21362136
#[stable(feature = "unsafe_cell_from_mut", since = "1.84.0")]
21372137
#[rustc_const_stable(feature = "unsafe_cell_from_mut", since = "1.84.0")]
2138-
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
21392138
pub const fn from_mut(value: &mut T) -> &mut UnsafeCell<T> {
21402139
// SAFETY: `UnsafeCell<T>` has the same memory layout as `T` due to #[repr(transparent)].
21412140
unsafe { &mut *(value as *mut T as *mut UnsafeCell<T>) }
@@ -2160,7 +2159,7 @@ impl<T: ?Sized> UnsafeCell<T> {
21602159
#[inline(always)]
21612160
#[stable(feature = "rust1", since = "1.0.0")]
21622161
#[rustc_const_stable(feature = "const_unsafecell_get", since = "1.32.0")]
2163-
#[cfg_attr(not(bootstrap), rustc_as_ptr)]
2162+
#[rustc_as_ptr]
21642163
#[rustc_never_returns_null_ptr]
21652164
pub const fn get(&self) -> *mut T {
21662165
// We can just cast the pointer from `UnsafeCell<T>` to `T` because of
@@ -2308,7 +2307,7 @@ impl<T: ?Sized> SyncUnsafeCell<T> {
23082307
/// when casting to `&mut T`, and ensure that there are no mutations
23092308
/// or mutable aliases going on when casting to `&T`
23102309
#[inline]
2311-
#[cfg_attr(not(bootstrap), rustc_as_ptr)]
2310+
#[rustc_as_ptr]
23122311
#[rustc_never_returns_null_ptr]
23132312
pub const fn get(&self) -> *mut T {
23142313
self.value.get()

library/core/src/char/methods.rs

-5
Original file line numberDiff line numberDiff line change
@@ -1787,7 +1787,6 @@ const fn len_utf16(code: u32) -> usize {
17871787
/// Panics if the buffer is not large enough.
17881788
/// A buffer of length four is large enough to encode any `char`.
17891789
#[unstable(feature = "char_internals", reason = "exposed only for libstd", issue = "none")]
1790-
#[cfg_attr(bootstrap, rustc_const_stable(feature = "const_char_encode_utf8", since = "1.83.0"))]
17911790
#[doc(hidden)]
17921791
#[inline]
17931792
pub const fn encode_utf8_raw(code: u32, dst: &mut [u8]) -> &mut [u8] {
@@ -1836,10 +1835,6 @@ pub const fn encode_utf8_raw(code: u32, dst: &mut [u8]) -> &mut [u8] {
18361835
/// Panics if the buffer is not large enough.
18371836
/// A buffer of length 2 is large enough to encode any `char`.
18381837
#[unstable(feature = "char_internals", reason = "exposed only for libstd", issue = "none")]
1839-
#[cfg_attr(
1840-
bootstrap,
1841-
rustc_const_stable(feature = "const_char_encode_utf16", since = "1.84.0")
1842-
)]
18431838
#[doc(hidden)]
18441839
#[inline]
18451840
pub const fn encode_utf16_raw(mut code: u32, dst: &mut [u16]) -> &mut [u16] {

library/core/src/ffi/c_str.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,9 @@ enum FromBytesWithNulErrorKind {
138138

139139
// FIXME: const stability attributes should not be required here, I think
140140
impl FromBytesWithNulError {
141-
#[cfg_attr(bootstrap, rustc_const_stable(feature = "const_cstr_methods", since = "1.72.0"))]
142141
const fn interior_nul(pos: usize) -> FromBytesWithNulError {
143142
FromBytesWithNulError { kind: FromBytesWithNulErrorKind::InteriorNul(pos) }
144143
}
145-
#[cfg_attr(bootstrap, rustc_const_stable(feature = "const_cstr_methods", since = "1.72.0"))]
146144
const fn not_nul_terminated() -> FromBytesWithNulError {
147145
FromBytesWithNulError { kind: FromBytesWithNulErrorKind::NotNulTerminated }
148146
}
@@ -464,8 +462,7 @@ impl CStr {
464462
///
465463
/// ```no_run
466464
/// # #![allow(unused_must_use)]
467-
/// # #![cfg_attr(bootstrap, expect(temporary_cstring_as_ptr))]
468-
/// # #![cfg_attr(not(bootstrap), expect(dangling_pointers_from_temporaries))]
465+
/// # #![expect(dangling_pointers_from_temporaries)]
469466
/// use std::ffi::CString;
470467
///
471468
/// // Do not do this:
@@ -500,7 +497,7 @@ impl CStr {
500497
#[must_use]
501498
#[stable(feature = "rust1", since = "1.0.0")]
502499
#[rustc_const_stable(feature = "const_str_as_ptr", since = "1.32.0")]
503-
#[cfg_attr(not(bootstrap), rustc_as_ptr)]
500+
#[rustc_as_ptr]
504501
#[rustc_never_returns_null_ptr]
505502
pub const fn as_ptr(&self) -> *const c_char {
506503
self.inner.as_ptr()
@@ -732,7 +729,6 @@ impl AsRef<CStr> for CStr {
732729
/// located within `isize::MAX` from `ptr`.
733730
#[inline]
734731
#[unstable(feature = "cstr_internals", issue = "none")]
735-
#[cfg_attr(bootstrap, rustc_const_stable(feature = "const_cstr_from_ptr", since = "1.81.0"))]
736732
#[rustc_allow_const_fn_unstable(const_eval_select)]
737733
const unsafe fn strlen(ptr: *const c_char) -> usize {
738734
const_eval_select!(

library/core/src/future/future.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use crate::task::{Context, Poll};
2525
/// [`async`]: ../../std/keyword.async.html
2626
/// [`Waker`]: crate::task::Waker
2727
#[doc(notable_trait)]
28-
#[cfg_attr(not(bootstrap), doc(search_unbox))]
28+
#[doc(search_unbox)]
2929
#[must_use = "futures do nothing unless you `.await` or poll them"]
3030
#[stable(feature = "futures_api", since = "1.36.0")]
3131
#[lang = "future_trait"]

library/core/src/hint.rs

-1
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,6 @@ pub const fn black_box<T>(dummy: T) -> T {
506506
/// # }
507507
/// ```
508508
#[unstable(feature = "hint_must_use", issue = "94745")]
509-
#[cfg_attr(bootstrap, rustc_const_unstable(feature = "hint_must_use", issue = "94745"))]
510509
#[must_use] // <-- :)
511510
#[inline(always)]
512511
pub const fn must_use<T>(value: T) -> T {

0 commit comments

Comments
 (0)