Skip to content

Commit 67b0cfc

Browse files
Flip cfg's for bootstrap bump
1 parent 7559d96 commit 67b0cfc

File tree

14 files changed

+16
-73
lines changed

14 files changed

+16
-73
lines changed

compiler/rustc_ast/src/token.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
1111
use rustc_data_structures::sync::Lrc;
1212
use rustc_macros::HashStable_Generic;
1313
use rustc_span::symbol::{kw, sym};
14-
#[cfg_attr(not(bootstrap), allow(hidden_glob_reexports))]
14+
#[allow(hidden_glob_reexports)]
1515
use rustc_span::symbol::{Ident, Symbol};
1616
use rustc_span::{self, edition::Edition, Span, DUMMY_SP};
1717
use std::borrow::Cow;

compiler/rustc_middle/src/ty/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ mod opaque_types;
149149
mod parameterized;
150150
mod rvalue_scopes;
151151
mod structural_impls;
152-
#[cfg_attr(not(bootstrap), allow(hidden_glob_reexports))]
152+
#[allow(hidden_glob_reexports)]
153153
mod sty;
154154
mod typeck_results;
155155

compiler/rustc_trait_selection/src/traits/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ mod object_safety;
1313
pub mod outlives_bounds;
1414
pub mod project;
1515
pub mod query;
16-
#[cfg_attr(not(bootstrap), allow(hidden_glob_reexports))]
16+
#[allow(hidden_glob_reexports)]
1717
mod select;
1818
mod specialize;
1919
mod structural_match;
2020
mod structural_normalize;
21-
#[cfg_attr(not(bootstrap), allow(hidden_glob_reexports))]
21+
#[allow(hidden_glob_reexports)]
2222
mod util;
2323
pub mod vtable;
2424
pub mod wf;

library/alloc/src/alloc.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@
44

55
#[cfg(not(test))]
66
use core::intrinsics;
7-
#[cfg(all(bootstrap, not(test)))]
8-
use core::intrinsics::{min_align_of_val, size_of_val};
97

10-
#[cfg(all(bootstrap, not(test)))]
11-
use core::ptr::Unique;
128
#[cfg(not(test))]
139
use core::ptr::{self, NonNull};
1410

@@ -337,23 +333,6 @@ unsafe fn exchange_malloc(size: usize, align: usize) -> *mut u8 {
337333
}
338334
}
339335

340-
#[cfg(all(bootstrap, not(test)))]
341-
#[lang = "box_free"]
342-
#[inline]
343-
// This signature has to be the same as `Box`, otherwise an ICE will happen.
344-
// When an additional parameter to `Box` is added (like `A: Allocator`), this has to be added here as
345-
// well.
346-
// For example if `Box` is changed to `struct Box<T: ?Sized, A: Allocator>(Unique<T>, A)`,
347-
// this function has to be changed to `fn box_free<T: ?Sized, A: Allocator>(Unique<T>, A)` as well.
348-
unsafe fn box_free<T: ?Sized, A: Allocator>(ptr: Unique<T>, alloc: A) {
349-
unsafe {
350-
let size = size_of_val(ptr.as_ref());
351-
let align = min_align_of_val(ptr.as_ref());
352-
let layout = Layout::from_size_align_unchecked(size, align);
353-
alloc.deallocate(From::from(ptr.cast()), layout)
354-
}
355-
}
356-
357336
// # Allocation error handler
358337

359338
#[cfg(not(no_global_oom_handling))]

library/alloc/tests/str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![cfg_attr(not(bootstrap), allow(invalid_from_utf8))]
1+
#![allow(invalid_from_utf8)]
22

33
use std::assert_matches::assert_matches;
44
use std::borrow::Cow;

library/core/src/any.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -697,9 +697,6 @@ impl TypeId {
697697
#[stable(feature = "rust1", since = "1.0.0")]
698698
#[rustc_const_unstable(feature = "const_type_id", issue = "77125")]
699699
pub const fn of<T: ?Sized + 'static>() -> TypeId {
700-
#[cfg(bootstrap)]
701-
let t = intrinsics::type_id::<T>() as u128;
702-
#[cfg(not(bootstrap))]
703700
let t: u128 = intrinsics::type_id::<T>();
704701
TypeId { t }
705702
}

library/core/src/intrinsics.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,23 +1057,6 @@ extern "rust-intrinsic" {
10571057
#[rustc_const_unstable(feature = "const_type_id", issue = "77125")]
10581058
#[rustc_safe_intrinsic]
10591059
#[rustc_nounwind]
1060-
#[cfg(bootstrap)]
1061-
pub fn type_id<T: ?Sized + 'static>() -> u64;
1062-
1063-
/// Gets an identifier which is globally unique to the specified type. This
1064-
/// function will return the same value for a type regardless of whichever
1065-
/// crate it is invoked in.
1066-
///
1067-
/// Note that, unlike most intrinsics, this is safe to call;
1068-
/// it does not require an `unsafe` block.
1069-
/// Therefore, implementations must not require the user to uphold
1070-
/// any safety invariants.
1071-
///
1072-
/// The stabilized version of this intrinsic is [`core::any::TypeId::of`].
1073-
#[rustc_const_unstable(feature = "const_type_id", issue = "77125")]
1074-
#[rustc_safe_intrinsic]
1075-
#[rustc_nounwind]
1076-
#[cfg(not(bootstrap))]
10771060
pub fn type_id<T: ?Sized + 'static>() -> u128;
10781061

10791062
/// A guard for unsafe functions that cannot ever be executed if `T` is uninhabited:

library/core/src/iter/adapters/flatten.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ where
310310
/// Real logic of both `Flatten` and `FlatMap` which simply delegate to
311311
/// this type.
312312
#[derive(Clone, Debug)]
313-
#[cfg_attr(bootstrap, unstable(feature = "trusted_len", issue = "37572"))]
313+
#[unstable(feature = "trusted_len", issue = "37572")]
314314
struct FlattenCompat<I, U> {
315315
iter: Fuse<I>,
316316
frontiter: Option<U>,
@@ -464,7 +464,6 @@ where
464464
}
465465
}
466466

467-
#[cfg_attr(bootstrap, unstable(feature = "trusted_len", issue = "37572"))]
468467
impl<I, U> Iterator for FlattenCompat<I, U>
469468
where
470469
I: Iterator<Item: IntoIterator<IntoIter = U, Item = U::Item>>,
@@ -579,7 +578,6 @@ where
579578
}
580579
}
581580

582-
#[cfg_attr(bootstrap, unstable(feature = "trusted_len", issue = "37572"))]
583581
impl<I, U> DoubleEndedIterator for FlattenCompat<I, U>
584582
where
585583
I: DoubleEndedIterator<Item: IntoIterator<IntoIter = U, Item = U::Item>>,
@@ -649,23 +647,20 @@ where
649647
}
650648
}
651649

652-
#[cfg_attr(bootstrap, unstable(feature = "trusted_len", issue = "37572"))]
653650
unsafe impl<const N: usize, I, T> TrustedLen
654651
for FlattenCompat<I, <[T; N] as IntoIterator>::IntoIter>
655652
where
656653
I: TrustedLen<Item = [T; N]>,
657654
{
658655
}
659656

660-
#[cfg_attr(bootstrap, unstable(feature = "trusted_len", issue = "37572"))]
661657
unsafe impl<'a, const N: usize, I, T> TrustedLen
662658
for FlattenCompat<I, <&'a [T; N] as IntoIterator>::IntoIter>
663659
where
664660
I: TrustedLen<Item = &'a [T; N]>,
665661
{
666662
}
667663

668-
#[cfg_attr(bootstrap, unstable(feature = "trusted_len", issue = "37572"))]
669664
unsafe impl<'a, const N: usize, I, T> TrustedLen
670665
for FlattenCompat<I, <&'a mut [T; N] as IntoIterator>::IntoIter>
671666
where

library/core/src/marker.rs

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,7 @@ unsafe impl<T: Sync + ?Sized> Send for &T {}
140140
)]
141141
#[fundamental] // for Default, for example, which requires that `[T]: !Default` be evaluatable
142142
#[rustc_specialization_trait]
143-
#[cfg_attr(not(bootstrap), rustc_deny_explicit_impl(implement_via_object = false))]
144-
#[cfg_attr(bootstrap, rustc_deny_explicit_impl)]
143+
#[rustc_deny_explicit_impl(implement_via_object = false)]
145144
#[rustc_coinductive]
146145
pub trait Sized {
147146
// Empty.
@@ -174,8 +173,7 @@ pub trait Sized {
174173
/// [nomicon-coerce]: ../../nomicon/coercions.html
175174
#[unstable(feature = "unsize", issue = "18598")]
176175
#[lang = "unsize"]
177-
#[cfg_attr(not(bootstrap), rustc_deny_explicit_impl(implement_via_object = false))]
178-
#[cfg_attr(bootstrap, rustc_deny_explicit_impl)]
176+
#[rustc_deny_explicit_impl(implement_via_object = false)]
179177
pub trait Unsize<T: ?Sized> {
180178
// Empty.
181179
}
@@ -856,8 +854,7 @@ impl<T: ?Sized> StructuralEq for PhantomData<T> {}
856854
reason = "this trait is unlikely to ever be stabilized, use `mem::discriminant` instead"
857855
)]
858856
#[lang = "discriminant_kind"]
859-
#[cfg_attr(not(bootstrap), rustc_deny_explicit_impl(implement_via_object = false))]
860-
#[cfg_attr(bootstrap, rustc_deny_explicit_impl)]
857+
#[rustc_deny_explicit_impl(implement_via_object = false)]
861858
pub trait DiscriminantKind {
862859
/// The type of the discriminant, which must satisfy the trait
863860
/// bounds required by `mem::Discriminant`.
@@ -962,8 +959,7 @@ marker_impls! {
962959
#[unstable(feature = "const_trait_impl", issue = "67792")]
963960
#[lang = "destruct"]
964961
#[rustc_on_unimplemented(message = "can't drop `{Self}`", append_const_msg)]
965-
#[cfg_attr(not(bootstrap), rustc_deny_explicit_impl(implement_via_object = false))]
966-
#[cfg_attr(bootstrap, rustc_deny_explicit_impl)]
962+
#[rustc_deny_explicit_impl(implement_via_object = false)]
967963
#[const_trait]
968964
pub trait Destruct {}
969965

@@ -974,8 +970,7 @@ pub trait Destruct {}
974970
#[unstable(feature = "tuple_trait", issue = "none")]
975971
#[lang = "tuple_trait"]
976972
#[rustc_on_unimplemented(message = "`{Self}` is not a tuple")]
977-
#[cfg_attr(not(bootstrap), rustc_deny_explicit_impl(implement_via_object = false))]
978-
#[cfg_attr(bootstrap, rustc_deny_explicit_impl)]
973+
#[rustc_deny_explicit_impl(implement_via_object = false)]
979974
pub trait Tuple {}
980975

981976
/// A marker for pointer-like types.
@@ -1020,7 +1015,6 @@ marker_impls! {
10201015

10211016
// FIXME(adt_const_params): Add to marker_impls call above once not in bootstrap
10221017
#[unstable(feature = "adt_const_params", issue = "95174")]
1023-
#[cfg(not(bootstrap))]
10241018
impl ConstParamTy for () {}
10251019

10261020
/// A common trait implemented by all function pointers.
@@ -1030,8 +1024,7 @@ impl ConstParamTy for () {}
10301024
reason = "internal trait for implementing various traits for all function pointers"
10311025
)]
10321026
#[lang = "fn_ptr_trait"]
1033-
#[cfg_attr(not(bootstrap), rustc_deny_explicit_impl(implement_via_object = false))]
1034-
#[cfg_attr(bootstrap, rustc_deny_explicit_impl)]
1027+
#[rustc_deny_explicit_impl(implement_via_object = false)]
10351028
pub trait FnPtr: Copy + Clone {
10361029
/// Returns the address of the function pointer.
10371030
#[lang = "fn_ptr_addr"]

library/core/src/mem/transmutability.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ use crate::marker::ConstParamTy;
77
/// notwithstanding whatever safety checks you have asked the compiler to [`Assume`] are satisfied.
88
#[unstable(feature = "transmutability", issue = "99571")]
99
#[lang = "transmute_trait"]
10-
#[cfg_attr(not(bootstrap), rustc_deny_explicit_impl(implement_via_object = false))]
11-
#[cfg_attr(bootstrap, rustc_deny_explicit_impl)]
10+
#[rustc_deny_explicit_impl(implement_via_object = false)]
1211
#[rustc_coinductive]
1312
pub unsafe trait BikeshedIntrinsicFrom<Src, Context, const ASSUME: Assume = { Assume::NOTHING }>
1413
where

library/core/src/ptr/metadata.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ use crate::hash::{Hash, Hasher};
5050
///
5151
/// [`to_raw_parts`]: *const::to_raw_parts
5252
#[lang = "pointee_trait"]
53-
#[cfg_attr(not(bootstrap), rustc_deny_explicit_impl(implement_via_object = false))]
54-
#[cfg_attr(bootstrap, rustc_deny_explicit_impl)]
53+
#[rustc_deny_explicit_impl(implement_via_object = false)]
5554
pub trait Pointee {
5655
/// The type for metadata in pointers and references to `Self`.
5756
#[lang = "metadata_type"]

library/core/src/ptr/unique.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use crate::ptr::NonNull;
3333
#[doc(hidden)]
3434
#[repr(transparent)]
3535
// Lang item used experimentally by Miri to define the semantics of `Unique`.
36-
#[cfg_attr(not(bootstrap), lang = "ptr_unique")]
36+
#[lang = "ptr_unique"]
3737
pub struct Unique<T: ?Sized> {
3838
pointer: NonNull<T>,
3939
// NOTE: this marker has no consequences for variance, but is necessary

library/core/src/tuple.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// See src/libstd/primitive_docs.rs for documentation.
22

33
use crate::cmp::Ordering::{self, *};
4-
#[cfg(not(bootstrap))]
54
use crate::marker::ConstParamTy;
65
use crate::marker::{StructuralEq, StructuralPartialEq};
76

@@ -51,7 +50,6 @@ macro_rules! tuple_impls {
5150
maybe_tuple_doc! {
5251
$($T)+ @
5352
#[unstable(feature = "structural_match", issue = "31434")]
54-
#[cfg(not(bootstrap))]
5553
impl<$($T: ConstParamTy),+> ConstParamTy for ($($T,)+)
5654
{}
5755
}

library/core/tests/manually_drop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![cfg_attr(not(bootstrap), allow(undropped_manually_drops))]
1+
#![allow(undropped_manually_drops)]
22

33
use core::mem::ManuallyDrop;
44

0 commit comments

Comments
 (0)