Skip to content

Commit d8150f0

Browse files
committed
update cfg(bootstrap)
1 parent 75003d6 commit d8150f0

File tree

32 files changed

+216
-408
lines changed

32 files changed

+216
-408
lines changed

alloc/src/string.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1832,7 +1832,7 @@ impl String {
18321832
#[stable(feature = "rust1", since = "1.0.0")]
18331833
#[rustc_const_stable(feature = "const_vec_string_slice", since = "1.87.0")]
18341834
#[rustc_confusables("length", "size")]
1835-
#[cfg_attr(not(bootstrap), rustc_no_implicit_autorefs)]
1835+
#[rustc_no_implicit_autorefs]
18361836
pub const fn len(&self) -> usize {
18371837
self.vec.len()
18381838
}
@@ -1852,7 +1852,7 @@ impl String {
18521852
#[must_use]
18531853
#[stable(feature = "rust1", since = "1.0.0")]
18541854
#[rustc_const_stable(feature = "const_vec_string_slice", since = "1.87.0")]
1855-
#[cfg_attr(not(bootstrap), rustc_no_implicit_autorefs)]
1855+
#[rustc_no_implicit_autorefs]
18561856
pub const fn is_empty(&self) -> bool {
18571857
self.len() == 0
18581858
}

alloctests/tests/fmt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![deny(warnings)]
22
// FIXME(static_mut_refs): Do not allow `static_mut_refs` lint
33
#![allow(static_mut_refs)]
4-
#![cfg_attr(not(bootstrap), allow(unnecessary_transmutes))]
4+
#![allow(unnecessary_transmutes)]
55

66
use std::cell::RefCell;
77
use std::fmt::{self, Write};

core/src/char/convert.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub(super) const fn from_u32(i: u32) -> Option<char> {
2121
/// Converts a `u32` to a `char`, ignoring validity. See [`char::from_u32_unchecked`].
2222
#[inline]
2323
#[must_use]
24-
#[cfg_attr(not(bootstrap), allow(unnecessary_transmutes))]
24+
#[allow(unnecessary_transmutes)]
2525
pub(super) const unsafe fn from_u32_unchecked(i: u32) -> char {
2626
// SAFETY: the caller must guarantee that `i` is a valid char value.
2727
unsafe {
@@ -222,7 +222,7 @@ impl FromStr for char {
222222
}
223223

224224
#[inline]
225-
#[cfg_attr(not(bootstrap), allow(unnecessary_transmutes))]
225+
#[allow(unnecessary_transmutes)]
226226
const fn char_try_from_u32(i: u32) -> Result<char, CharTryFromError> {
227227
// This is an optimized version of the check
228228
// (i > MAX as u32) || (i >= 0xD800 && i <= 0xDFFF),

core/src/fmt/rt.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,6 @@ pub struct Placeholder {
1919
pub width: Count,
2020
}
2121

22-
#[cfg(bootstrap)]
23-
impl Placeholder {
24-
#[inline]
25-
pub const fn new(position: usize, flags: u32, precision: Count, width: Count) -> Self {
26-
Self { position, flags, precision, width }
27-
}
28-
}
29-
3022
/// Used by [width](https://doc.rust-lang.org/std/fmt/#width)
3123
/// and [precision](https://doc.rust-lang.org/std/fmt/#precision) specifiers.
3224
#[lang = "format_count"]

core/src/future/async_drop.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ use crate::task::{Context, Poll};
2424
/// are `Copy` get implicitly duplicated by the compiler, making it very
2525
/// hard to predict when, and how often destructors will be executed. As such,
2626
/// these types cannot have destructors.
27-
#[cfg(not(bootstrap))]
2827
#[unstable(feature = "async_drop", issue = "126482")]
2928
#[lang = "async_drop"]
3029
pub trait AsyncDrop {
@@ -42,7 +41,6 @@ pub trait AsyncDrop {
4241
}
4342

4443
/// Async drop.
45-
#[cfg(not(bootstrap))]
4644
#[unstable(feature = "async_drop", issue = "126482")]
4745
#[lang = "async_drop_in_place"]
4846
pub async unsafe fn async_drop_in_place<T: ?Sized>(_to_drop: *mut T) {

core/src/future/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ mod pending;
2020
mod poll_fn;
2121
mod ready;
2222

23-
#[cfg(not(bootstrap))]
2423
#[unstable(feature = "async_drop", issue = "126482")]
2524
pub use async_drop::{AsyncDrop, async_drop_in_place};
2625
#[stable(feature = "into_future", since = "1.64.0")]

core/src/intrinsics/mod.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,7 +1476,7 @@ pub const fn forget<T: ?Sized>(_: T);
14761476
/// Turning raw bytes (`[u8; SZ]`) into `u32`, `f64`, etc.:
14771477
///
14781478
/// ```
1479-
/// # #![cfg_attr(not(bootstrap), allow(unnecessary_transmutes))]
1479+
/// # #![allow(unnecessary_transmutes)]
14801480
/// let raw_bytes = [0x78, 0x56, 0x34, 0x12];
14811481
///
14821482
/// let num = unsafe {
@@ -3413,7 +3413,6 @@ pub const fn contract_check_requires<C: Fn() -> bool + Copy>(cond: C) {
34133413
/// returns false.
34143414
///
34153415
/// Note that this function is a no-op during constant evaluation.
3416-
#[cfg(not(bootstrap))]
34173416
#[unstable(feature = "contracts_internals", issue = "128044")]
34183417
// Similar to `contract_check_requires`, we need to use the user-facing
34193418
// `contracts` feature rather than the perma-unstable `contracts_internals`.
@@ -3437,16 +3436,6 @@ pub const fn contract_check_ensures<C: Fn(&Ret) -> bool + Copy, Ret>(cond: C, re
34373436
)
34383437
}
34393438

3440-
/// This is the old version of contract_check_ensures kept here for bootstrap only.
3441-
#[cfg(bootstrap)]
3442-
#[unstable(feature = "contracts_internals", issue = "128044" /* compiler-team#759 */)]
3443-
#[rustc_intrinsic]
3444-
pub fn contract_check_ensures<'a, Ret, C: Fn(&'a Ret) -> bool>(ret: &'a Ret, cond: C) {
3445-
if contract_checks() && !cond(ret) {
3446-
crate::panicking::panic_nounwind("failed ensures check");
3447-
}
3448-
}
3449-
34503439
/// The intrinsic will return the size stored in that vtable.
34513440
///
34523441
/// # Safety

core/src/intrinsics/simd.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub const unsafe fn simd_extract<T, U>(x: T, idx: u32) -> U;
3434
///
3535
/// `idx` must be in-bounds of the vector.
3636
#[rustc_nounwind]
37-
#[cfg_attr(not(bootstrap), rustc_intrinsic)]
37+
#[rustc_intrinsic]
3838
pub unsafe fn simd_insert_dyn<T, U>(mut x: T, idx: u32, val: U) -> T {
3939
// SAFETY: `idx` must be in-bounds
4040
unsafe { (&raw mut x).cast::<U>().add(idx as usize).write(val) }
@@ -51,7 +51,7 @@ pub unsafe fn simd_insert_dyn<T, U>(mut x: T, idx: u32, val: U) -> T {
5151
///
5252
/// `idx` must be in-bounds of the vector.
5353
#[rustc_nounwind]
54-
#[cfg_attr(not(bootstrap), rustc_intrinsic)]
54+
#[rustc_intrinsic]
5555
pub unsafe fn simd_extract_dyn<T, U>(x: T, idx: u32) -> U {
5656
// SAFETY: `idx` must be in-bounds
5757
unsafe { (&raw const x).cast::<U>().add(idx as usize).read() }

core/src/marker.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -885,8 +885,7 @@ marker_impls! {
885885
///
886886
/// This is part of [RFC 3467](https://rust-lang.github.io/rfcs/3467-unsafe-pinned.html), and is
887887
/// tracked by [#125735](https://github.com/rust-lang/rust/issues/125735).
888-
#[cfg_attr(not(bootstrap), lang = "unsafe_unpin")]
889-
#[cfg_attr(bootstrap, allow(dead_code))]
888+
#[lang = "unsafe_unpin"]
890889
pub(crate) unsafe auto trait UnsafeUnpin {}
891890

892891
impl<T: ?Sized> !UnsafeUnpin for UnsafePinned<T> {}

core/src/num/f128.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@ impl f128 {
893893
#[inline]
894894
#[unstable(feature = "f128", issue = "116909")]
895895
#[must_use = "this returns the result of the operation, without modifying the original"]
896-
#[cfg_attr(not(bootstrap), allow(unnecessary_transmutes))]
896+
#[allow(unnecessary_transmutes)]
897897
pub const fn to_bits(self) -> u128 {
898898
// SAFETY: `u128` is a plain old datatype so we can always transmute to it.
899899
unsafe { mem::transmute(self) }
@@ -941,7 +941,7 @@ impl f128 {
941941
#[inline]
942942
#[must_use]
943943
#[unstable(feature = "f128", issue = "116909")]
944-
#[cfg_attr(not(bootstrap), allow(unnecessary_transmutes))]
944+
#[allow(unnecessary_transmutes)]
945945
pub const fn from_bits(v: u128) -> Self {
946946
// It turns out the safety issues with sNaN were overblown! Hooray!
947947
// SAFETY: `u128` is a plain old datatype so we can always transmute from it.

0 commit comments

Comments
 (0)