Skip to content

Commit 2af3ba9

Browse files
committed
update cfg(bootstrap)
1 parent 79b00df commit 2af3ba9

File tree

29 files changed

+49
-169
lines changed

29 files changed

+49
-169
lines changed

compiler/rustc_ast/src/util/comments/tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![cfg_attr(not(bootstrap), allow(rustc::symbol_intern_string_literal))]
1+
#![allow(rustc::symbol_intern_string_literal)]
22

33
use rustc_span::create_default_session_globals_then;
44

compiler/rustc_ast_passes/src/feature_gate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ fn check_new_solver_banned_features(sess: &Session, features: &Features) {
692692
.find(|feat| feat.gate_name == sym::generic_const_exprs)
693693
.map(|feat| feat.attr_sp)
694694
{
695-
#[cfg_attr(not(bootstrap), allow(rustc::symbol_intern_string_literal))]
695+
#[allow(rustc::symbol_intern_string_literal)]
696696
sess.dcx().emit_err(errors::IncompatibleFeatures {
697697
spans: vec![gce_span],
698698
f1: Symbol::intern("-Znext-solver=globally"),

compiler/rustc_hir/src/tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![cfg_attr(not(bootstrap), allow(rustc::symbol_intern_string_literal))]
1+
#![allow(rustc::symbol_intern_string_literal)]
22

33
use rustc_data_structures::stable_hasher::Hash64;
44
use rustc_span::def_id::{DefPathHash, StableCrateId};

compiler/rustc_lint/src/tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![cfg_attr(not(bootstrap), allow(rustc::symbol_intern_string_literal))]
1+
#![allow(rustc::symbol_intern_string_literal)]
22

33
use rustc_span::{Symbol, create_default_session_globals_then};
44

compiler/rustc_metadata/src/creader.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ impl<'a, 'tcx> CrateLoader<'a, 'tcx> {
867867
// First up we check for global allocators. Look at the crate graph here
868868
// and see what's a global allocator, including if we ourselves are a
869869
// global allocator.
870-
#[cfg_attr(not(bootstrap), allow(rustc::symbol_intern_string_literal))]
870+
#[allow(rustc::symbol_intern_string_literal)]
871871
let this_crate = Symbol::intern("this crate");
872872

873873
let mut global_allocator = self.cstore.has_global_allocator.then_some(this_crate);

compiler/rustc_metadata/src/rmeta/decoder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ impl MetadataBlob {
871871

872872
let def_kind = root.tables.def_kind.get(blob, item).unwrap();
873873
let def_key = root.tables.def_keys.get(blob, item).unwrap().decode(blob);
874-
#[cfg_attr(not(bootstrap), allow(rustc::symbol_intern_string_literal))]
874+
#[allow(rustc::symbol_intern_string_literal)]
875875
let def_name = if item == CRATE_DEF_INDEX {
876876
kw::Crate
877877
} else {

compiler/rustc_parse/src/parser/tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![cfg_attr(not(bootstrap), allow(rustc::symbol_intern_string_literal))]
1+
#![allow(rustc::symbol_intern_string_literal)]
22

33
use std::assert_matches::assert_matches;
44
use std::io::prelude::*;

compiler/rustc_parse/src/parser/tokenstream/tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![cfg_attr(not(bootstrap), allow(rustc::symbol_intern_string_literal))]
1+
#![allow(rustc::symbol_intern_string_literal)]
22

33
use rustc_ast::token::{self, IdentIsRaw};
44
use rustc_ast::tokenstream::{TokenStream, TokenTree};

compiler/rustc_resolve/src/late/diagnostics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3155,7 +3155,7 @@ impl<'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
31553155
}
31563156
}
31573157

3158-
#[cfg_attr(not(bootstrap), allow(rustc::symbol_intern_string_literal))]
3158+
#[allow(rustc::symbol_intern_string_literal)]
31593159
let existing_name = match &in_scope_lifetimes[..] {
31603160
[] => Symbol::intern("'a"),
31613161
[(existing, _)] => existing.name,

compiler/rustc_span/src/edit_distance/tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![cfg_attr(not(bootstrap), allow(rustc::symbol_intern_string_literal))]
1+
#![allow(rustc::symbol_intern_string_literal)]
22

33
use super::*;
44

library/alloc/src/boxed.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -2028,8 +2028,7 @@ impl<Args: Tuple, F: Fn<Args> + ?Sized, A: Allocator> Fn<Args> for Box<F, A> {
20282028
}
20292029
}
20302030

2031-
#[cfg_attr(bootstrap, unstable(feature = "async_closure", issue = "62290"))]
2032-
#[cfg_attr(not(bootstrap), stable(feature = "async_closure", since = "1.85.0"))]
2031+
#[stable(feature = "async_closure", since = "1.85.0")]
20332032
impl<Args: Tuple, F: AsyncFnOnce<Args> + ?Sized, A: Allocator> AsyncFnOnce<Args> for Box<F, A> {
20342033
type Output = F::Output;
20352034
type CallOnceFuture = F::CallOnceFuture;
@@ -2039,8 +2038,7 @@ impl<Args: Tuple, F: AsyncFnOnce<Args> + ?Sized, A: Allocator> AsyncFnOnce<Args>
20392038
}
20402039
}
20412040

2042-
#[cfg_attr(bootstrap, unstable(feature = "async_closure", issue = "62290"))]
2043-
#[cfg_attr(not(bootstrap), stable(feature = "async_closure", since = "1.85.0"))]
2041+
#[stable(feature = "async_closure", since = "1.85.0")]
20442042
impl<Args: Tuple, F: AsyncFnMut<Args> + ?Sized, A: Allocator> AsyncFnMut<Args> for Box<F, A> {
20452043
type CallRefFuture<'a>
20462044
= F::CallRefFuture<'a>
@@ -2052,8 +2050,7 @@ impl<Args: Tuple, F: AsyncFnMut<Args> + ?Sized, A: Allocator> AsyncFnMut<Args> f
20522050
}
20532051
}
20542052

2055-
#[cfg_attr(bootstrap, unstable(feature = "async_closure", issue = "62290"))]
2056-
#[cfg_attr(not(bootstrap), stable(feature = "async_closure", since = "1.85.0"))]
2053+
#[stable(feature = "async_closure", since = "1.85.0")]
20572054
impl<Args: Tuple, F: AsyncFn<Args> + ?Sized, A: Allocator> AsyncFn<Args> for Box<F, A> {
20582055
extern "rust-call" fn async_call(&self, args: Args) -> Self::CallRefFuture<'_> {
20592056
F::async_call(self, args)

library/alloc/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@
9191
//
9292
// Library features:
9393
// tidy-alphabetical-start
94-
#![cfg_attr(bootstrap, feature(async_closure))]
9594
#![cfg_attr(test, feature(str_as_str))]
9695
#![feature(alloc_layout_extra)]
9796
#![feature(allocator_api)]

library/core/src/arch.rs

-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ pub macro global_asm("assembly template", $(operands,)* $(options($(option),*))?
6565
// When stabilizing this, update the comment on `core::intrinsics::breakpoint`.
6666
#[unstable(feature = "breakpoint", issue = "133724")]
6767
#[inline(always)]
68-
#[cfg(not(bootstrap))]
6968
pub fn breakpoint() {
7069
core::intrinsics::breakpoint();
7170
}

library/core/src/future/async_drop.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,8 @@ pub trait AsyncDrop {
133133
}
134134

135135
#[lang = "async_destruct"]
136-
#[cfg_attr(bootstrap, rustc_deny_explicit_impl(implement_via_object = false))]
137-
#[cfg_attr(not(bootstrap), rustc_deny_explicit_impl)]
138-
#[cfg_attr(not(bootstrap), rustc_do_not_implement_via_object)]
136+
#[rustc_deny_explicit_impl]
137+
#[rustc_do_not_implement_via_object]
139138
trait AsyncDestruct {
140139
type AsyncDestructor: Future<Output = ()>;
141140
}

library/core/src/intrinsics/mod.rs

+2-30
Original file line numberDiff line numberDiff line change
@@ -1382,22 +1382,10 @@ pub unsafe fn prefetch_write_instruction<T>(_data: *const T, _locality: i32) {
13821382
#[rustc_intrinsic]
13831383
#[rustc_intrinsic_must_be_overridden]
13841384
#[rustc_nounwind]
1385-
#[cfg(not(bootstrap))]
13861385
pub fn breakpoint() {
13871386
unreachable!()
13881387
}
13891388

1390-
/// Executes a breakpoint trap, for inspection by a debugger.
1391-
///
1392-
/// This intrinsic does not have a stable counterpart.
1393-
#[rustc_intrinsic]
1394-
#[rustc_intrinsic_must_be_overridden]
1395-
#[rustc_nounwind]
1396-
#[cfg(bootstrap)]
1397-
pub unsafe fn breakpoint() {
1398-
unreachable!()
1399-
}
1400-
14011389
/// Magic intrinsic that derives its meaning from attributes
14021390
/// attached to the function.
14031391
///
@@ -3323,8 +3311,8 @@ pub const fn mul_with_overflow<T: Copy>(_x: T, _y: T) -> (T, bool) {
33233311
#[unstable(feature = "core_intrinsics", issue = "none")]
33243312
#[rustc_const_unstable(feature = "const_carrying_mul_add", issue = "85532")]
33253313
#[rustc_nounwind]
3326-
#[cfg_attr(not(bootstrap), rustc_intrinsic)]
3327-
#[cfg_attr(not(bootstrap), miri::intrinsic_fallback_is_spec)]
3314+
#[rustc_intrinsic]
3315+
#[miri::intrinsic_fallback_is_spec]
33283316
pub const fn carrying_mul_add<T: ~const fallback::CarryingMulAdd<Unsigned = U>, U>(
33293317
multiplier: T,
33303318
multiplicand: T,
@@ -3969,21 +3957,6 @@ pub const fn is_val_statically_known<T: Copy>(_arg: T) -> bool {
39693957
false
39703958
}
39713959

3972-
#[rustc_nounwind]
3973-
#[inline]
3974-
#[rustc_intrinsic]
3975-
#[rustc_intrinsic_const_stable_indirect]
3976-
#[rustc_allow_const_fn_unstable(const_swap_nonoverlapping)] // this is anyway not called since CTFE implements the intrinsic
3977-
#[cfg(bootstrap)]
3978-
pub const unsafe fn typed_swap<T>(x: *mut T, y: *mut T) {
3979-
// SAFETY: The caller provided single non-overlapping items behind
3980-
// pointers, so swapping them with `count: 1` is fine.
3981-
unsafe { ptr::swap_nonoverlapping(x, y, 1) };
3982-
}
3983-
3984-
#[cfg(bootstrap)]
3985-
pub use typed_swap as typed_swap_nonoverlapping;
3986-
39873960
/// Non-overlapping *typed* swap of a single value.
39883961
///
39893962
/// The codegen backends will replace this with a better implementation when
@@ -3999,7 +3972,6 @@ pub use typed_swap as typed_swap_nonoverlapping;
39993972
#[rustc_intrinsic]
40003973
#[rustc_intrinsic_const_stable_indirect]
40013974
#[rustc_allow_const_fn_unstable(const_swap_nonoverlapping)] // this is anyway not called since CTFE implements the intrinsic
4002-
#[cfg(not(bootstrap))]
40033975
pub const unsafe fn typed_swap_nonoverlapping<T>(x: *mut T, y: *mut T) {
40043976
// SAFETY: The caller provided single non-overlapping items behind
40053977
// pointers, so swapping them with `count: 1` is fine.

library/core/src/intrinsics/simd.rs

-1
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,6 @@ extern "rust-intrinsic" {
623623
/// and others do not.
624624
///
625625
/// `T` must be a vector of floats.
626-
#[cfg(not(bootstrap))]
627626
#[rustc_nounwind]
628627
pub fn simd_relaxed_fma<T>(x: T, y: T, z: T) -> T;
629628

library/core/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@
107107
//
108108
// Library features:
109109
// tidy-alphabetical-start
110-
#![cfg_attr(bootstrap, feature(do_not_recommend))]
111110
#![feature(array_ptr_get)]
112111
#![feature(asm_experimental_arch)]
113112
#![feature(bigint_helper_methods)]

library/core/src/marker.rs

+14-22
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,8 @@ unsafe impl<T: Sync + ?Sized> Send for &T {}
141141
)]
142142
#[fundamental] // for Default, for example, which requires that `[T]: !Default` be evaluatable
143143
#[rustc_specialization_trait]
144-
#[cfg_attr(bootstrap, rustc_deny_explicit_impl(implement_via_object = false))]
145-
#[cfg_attr(not(bootstrap), rustc_deny_explicit_impl)]
146-
#[cfg_attr(not(bootstrap), rustc_do_not_implement_via_object)]
144+
#[rustc_deny_explicit_impl]
145+
#[rustc_do_not_implement_via_object]
147146
#[rustc_coinductive]
148147
pub trait Sized {
149148
// Empty.
@@ -183,9 +182,8 @@ pub trait Sized {
183182
/// [^1]: Formerly known as *object safe*.
184183
#[unstable(feature = "unsize", issue = "18598")]
185184
#[lang = "unsize"]
186-
#[cfg_attr(bootstrap, rustc_deny_explicit_impl(implement_via_object = false))]
187-
#[cfg_attr(not(bootstrap), rustc_deny_explicit_impl)]
188-
#[cfg_attr(not(bootstrap), rustc_do_not_implement_via_object)]
185+
#[rustc_deny_explicit_impl]
186+
#[rustc_do_not_implement_via_object]
189187
pub trait Unsize<T: ?Sized> {
190188
// Empty.
191189
}
@@ -819,9 +817,8 @@ impl<T: ?Sized> StructuralPartialEq for PhantomData<T> {}
819817
reason = "this trait is unlikely to ever be stabilized, use `mem::discriminant` instead"
820818
)]
821819
#[lang = "discriminant_kind"]
822-
#[cfg_attr(bootstrap, rustc_deny_explicit_impl(implement_via_object = false))]
823-
#[cfg_attr(not(bootstrap), rustc_deny_explicit_impl)]
824-
#[cfg_attr(not(bootstrap), rustc_do_not_implement_via_object)]
820+
#[rustc_deny_explicit_impl]
821+
#[rustc_do_not_implement_via_object]
825822
pub trait DiscriminantKind {
826823
/// The type of the discriminant, which must satisfy the trait
827824
/// bounds required by `mem::Discriminant`.
@@ -962,10 +959,9 @@ marker_impls! {
962959
#[unstable(feature = "const_destruct", issue = "133214")]
963960
#[lang = "destruct"]
964961
#[rustc_on_unimplemented(message = "can't drop `{Self}`", append_const_msg)]
965-
#[cfg_attr(bootstrap, rustc_deny_explicit_impl(implement_via_object = false))]
966-
#[cfg_attr(not(bootstrap), rustc_deny_explicit_impl)]
967-
#[cfg_attr(not(bootstrap), rustc_do_not_implement_via_object)]
968-
#[cfg_attr(not(bootstrap), const_trait)]
962+
#[rustc_deny_explicit_impl]
963+
#[rustc_do_not_implement_via_object]
964+
#[const_trait]
969965
pub trait Destruct {}
970966

971967
/// A marker for tuple types.
@@ -975,9 +971,8 @@ pub trait Destruct {}
975971
#[unstable(feature = "tuple_trait", issue = "none")]
976972
#[lang = "tuple_trait"]
977973
#[diagnostic::on_unimplemented(message = "`{Self}` is not a tuple")]
978-
#[cfg_attr(bootstrap, rustc_deny_explicit_impl(implement_via_object = false))]
979-
#[cfg_attr(not(bootstrap), rustc_deny_explicit_impl)]
980-
#[cfg_attr(not(bootstrap), rustc_do_not_implement_via_object)]
974+
#[rustc_deny_explicit_impl]
975+
#[rustc_do_not_implement_via_object]
981976
pub trait Tuple {}
982977

983978
/// A marker for pointer-like types.
@@ -996,10 +991,9 @@ pub trait Tuple {}
996991
message = "`{Self}` needs to have the same ABI as a pointer",
997992
label = "`{Self}` needs to be a pointer-like type"
998993
)]
999-
#[cfg_attr(not(bootstrap), rustc_do_not_implement_via_object)]
994+
#[rustc_do_not_implement_via_object]
1000995
pub trait PointerLike {}
1001996

1002-
#[cfg(not(bootstrap))]
1003997
marker_impls! {
1004998
#[unstable(feature = "pointer_like_trait", issue = "none")]
1005999
PointerLike for
@@ -1086,9 +1080,8 @@ marker_impls! {
10861080
reason = "internal trait for implementing various traits for all function pointers"
10871081
)]
10881082
#[lang = "fn_ptr_trait"]
1089-
#[cfg_attr(bootstrap, rustc_deny_explicit_impl(implement_via_object = false))]
1090-
#[cfg_attr(not(bootstrap), rustc_deny_explicit_impl)]
1091-
#[cfg_attr(not(bootstrap), rustc_do_not_implement_via_object)]
1083+
#[rustc_deny_explicit_impl]
1084+
#[rustc_do_not_implement_via_object]
10921085
pub trait FnPtr: Copy + Clone {
10931086
/// Returns the address of the function pointer.
10941087
#[lang = "fn_ptr_addr"]
@@ -1099,7 +1092,6 @@ pub trait FnPtr: Copy + Clone {
10991092
#[rustc_builtin_macro(CoercePointee, attributes(pointee))]
11001093
#[allow_internal_unstable(dispatch_from_dyn, coerce_unsized, unsize)]
11011094
#[unstable(feature = "derive_coerce_pointee", issue = "123430")]
1102-
#[cfg(not(bootstrap))]
11031095
pub macro CoercePointee($item:item) {
11041096
/* compiler built-in */
11051097
}

library/core/src/mem/transmutability.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,8 @@ use crate::marker::{ConstParamTy_, UnsizedConstParamTy};
8484
/// `usize` is stable, but not portable.
8585
#[unstable(feature = "transmutability", issue = "99571")]
8686
#[lang = "transmute_trait"]
87-
#[cfg_attr(bootstrap, rustc_deny_explicit_impl(implement_via_object = false))]
88-
#[cfg_attr(not(bootstrap), rustc_deny_explicit_impl)]
89-
#[cfg_attr(not(bootstrap), rustc_do_not_implement_via_object)]
87+
#[rustc_deny_explicit_impl]
88+
#[rustc_do_not_implement_via_object]
9089
#[rustc_coinductive]
9190
pub unsafe trait TransmuteFrom<Src, const ASSUME: Assume = { Assume::NOTHING }>
9291
where

library/core/src/ops/arith.rs

+1-13
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
append_const_msg
7474
)]
7575
#[doc(alias = "+")]
76-
#[cfg_attr(not(bootstrap), const_trait)]
76+
#[const_trait]
7777
pub trait Add<Rhs = Self> {
7878
/// The resulting type after applying the `+` operator.
7979
#[stable(feature = "rust1", since = "1.0.0")]
@@ -95,18 +95,6 @@ pub trait Add<Rhs = Self> {
9595
macro_rules! add_impl {
9696
($($t:ty)*) => ($(
9797
#[stable(feature = "rust1", since = "1.0.0")]
98-
#[cfg(bootstrap)]
99-
impl Add for $t {
100-
type Output = $t;
101-
102-
#[inline]
103-
#[track_caller]
104-
#[rustc_inherit_overflow_checks]
105-
fn add(self, other: $t) -> $t { self + other }
106-
}
107-
108-
#[stable(feature = "rust1", since = "1.0.0")]
109-
#[cfg(not(bootstrap))]
11098
impl const Add for $t {
11199
type Output = $t;
112100

0 commit comments

Comments
 (0)