Skip to content

Commit 85a277c

Browse files
cuvipergitbot
authored and
gitbot
committed
update cfg(bootstrap)
1 parent c8506dd commit 85a277c

File tree

13 files changed

+14
-338
lines changed

13 files changed

+14
-338
lines changed

alloc/src/boxed.rs

-10
Original file line numberDiff line numberDiff line change
@@ -237,23 +237,13 @@ pub struct Box<
237237
/// the newly allocated memory. This is an intrinsic to avoid unnecessary copies.
238238
///
239239
/// This is the surface syntax for `box <expr>` expressions.
240-
#[cfg(not(bootstrap))]
241240
#[rustc_intrinsic]
242241
#[rustc_intrinsic_must_be_overridden]
243242
#[unstable(feature = "liballoc_internals", issue = "none")]
244243
pub fn box_new<T>(_x: T) -> Box<T> {
245244
unreachable!()
246245
}
247246

248-
/// Transition function for the next bootstrap bump.
249-
#[cfg(bootstrap)]
250-
#[unstable(feature = "liballoc_internals", issue = "none")]
251-
#[inline(always)]
252-
pub fn box_new<T>(x: T) -> Box<T> {
253-
#[rustc_box]
254-
Box::new(x)
255-
}
256-
257247
impl<T> Box<T> {
258248
/// Allocates memory on the heap and then places `x` into it.
259249
///

core/src/contracts.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//! Unstable module containing the unstable contracts lang items and attribute macros.
2-
#![cfg(not(bootstrap))]
32
43
pub use crate::macros::builtin::{contracts_ensures as ensures, contracts_requires as requires};
54

core/src/intrinsics/mod.rs

+6-29
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,7 @@ pub mod simd;
7878
use crate::sync::atomic::{self, AtomicBool, AtomicI32, AtomicIsize, AtomicU32, Ordering};
7979

8080
#[stable(feature = "drop_in_place", since = "1.8.0")]
81-
#[cfg_attr(bootstrap, rustc_allowed_through_unstable_modules)]
82-
#[cfg_attr(
83-
not(bootstrap),
84-
rustc_allowed_through_unstable_modules = "import this function via `std::ptr` instead"
85-
)]
81+
#[rustc_allowed_through_unstable_modules = "import this function via `std::ptr` instead"]
8682
#[deprecated(note = "no longer an intrinsic - use `ptr::drop_in_place` directly", since = "1.52.0")]
8783
#[inline]
8884
pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
@@ -1901,11 +1897,7 @@ pub const fn forget<T: ?Sized>(_: T) {
19011897
/// }
19021898
/// ```
19031899
#[stable(feature = "rust1", since = "1.0.0")]
1904-
#[cfg_attr(bootstrap, rustc_allowed_through_unstable_modules)]
1905-
#[cfg_attr(
1906-
not(bootstrap),
1907-
rustc_allowed_through_unstable_modules = "import this function via `std::mem` instead"
1908-
)]
1900+
#[rustc_allowed_through_unstable_modules = "import this function via `std::mem` instead"]
19091901
#[rustc_const_stable(feature = "const_transmute", since = "1.56.0")]
19101902
#[rustc_diagnostic_item = "transmute"]
19111903
#[rustc_nounwind]
@@ -3260,7 +3252,7 @@ pub const fn three_way_compare<T: Copy>(_lhs: T, _rhss: T) -> crate::cmp::Orderi
32603252
/// Otherwise it's immediate UB.
32613253
#[rustc_const_unstable(feature = "disjoint_bitor", issue = "135758")]
32623254
#[rustc_nounwind]
3263-
#[cfg_attr(not(bootstrap), rustc_intrinsic)]
3255+
#[rustc_intrinsic]
32643256
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
32653257
#[miri::intrinsic_fallback_is_spec] // the fallbacks all `assume` to tell Miri
32663258
pub const unsafe fn disjoint_bitor<T: ~const fallback::DisjointBitOr>(a: T, b: T) -> T {
@@ -4071,7 +4063,6 @@ pub const unsafe fn const_deallocate(_ptr: *mut u8, _size: usize, _align: usize)
40714063
/// of not prematurely commiting at compile-time to whether contract
40724064
/// checking is turned on, so that we can specify contracts in libstd
40734065
/// and let an end user opt into turning them on.
4074-
#[cfg(not(bootstrap))]
40754066
#[rustc_const_unstable(feature = "contracts_internals", issue = "128044" /* compiler-team#759 */)]
40764067
#[unstable(feature = "contracts_internals", issue = "128044" /* compiler-team#759 */)]
40774068
#[inline(always)]
@@ -4087,7 +4078,6 @@ pub const fn contract_checks() -> bool {
40874078
///
40884079
/// By default, if `contract_checks` is enabled, this will panic with no unwind if the condition
40894080
/// returns false.
4090-
#[cfg(not(bootstrap))]
40914081
#[unstable(feature = "contracts_internals", issue = "128044" /* compiler-team#759 */)]
40924082
#[lang = "contract_check_requires"]
40934083
#[rustc_intrinsic]
@@ -4102,7 +4092,6 @@ pub fn contract_check_requires<C: Fn() -> bool>(cond: C) {
41024092
///
41034093
/// By default, if `contract_checks` is enabled, this will panic with no unwind if the condition
41044094
/// returns false.
4105-
#[cfg(not(bootstrap))]
41064095
#[unstable(feature = "contracts_internals", issue = "128044" /* compiler-team#759 */)]
41074096
#[rustc_intrinsic]
41084097
pub fn contract_check_ensures<'a, Ret, C: Fn(&'a Ret) -> bool>(ret: &'a Ret, cond: C) {
@@ -4401,11 +4390,7 @@ pub const fn ptr_metadata<P: ptr::Pointee<Metadata = M> + ?Sized, M>(_ptr: *cons
44014390
/// [`Vec::append`]: ../../std/vec/struct.Vec.html#method.append
44024391
#[doc(alias = "memcpy")]
44034392
#[stable(feature = "rust1", since = "1.0.0")]
4404-
#[cfg_attr(bootstrap, rustc_allowed_through_unstable_modules)]
4405-
#[cfg_attr(
4406-
not(bootstrap),
4407-
rustc_allowed_through_unstable_modules = "import this function via `std::mem` instead"
4408-
)]
4393+
#[rustc_allowed_through_unstable_modules = "import this function via `std::mem` instead"]
44094394
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.83.0")]
44104395
#[inline(always)]
44114396
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
@@ -4509,11 +4494,7 @@ pub const unsafe fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: us
45094494
/// ```
45104495
#[doc(alias = "memmove")]
45114496
#[stable(feature = "rust1", since = "1.0.0")]
4512-
#[cfg_attr(bootstrap, rustc_allowed_through_unstable_modules)]
4513-
#[cfg_attr(
4514-
not(bootstrap),
4515-
rustc_allowed_through_unstable_modules = "import this function via `std::mem` instead"
4516-
)]
4497+
#[rustc_allowed_through_unstable_modules = "import this function via `std::mem` instead"]
45174498
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.83.0")]
45184499
#[inline(always)]
45194500
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
@@ -4596,11 +4577,7 @@ pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize) {
45964577
/// ```
45974578
#[doc(alias = "memset")]
45984579
#[stable(feature = "rust1", since = "1.0.0")]
4599-
#[cfg_attr(bootstrap, rustc_allowed_through_unstable_modules)]
4600-
#[cfg_attr(
4601-
not(bootstrap),
4602-
rustc_allowed_through_unstable_modules = "import this function via `std::mem` instead"
4603-
)]
4580+
#[rustc_allowed_through_unstable_modules = "import this function via `std::mem` instead"]
46044581
#[rustc_const_stable(feature = "const_ptr_write", since = "1.83.0")]
46054582
#[inline(always)]
46064583
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces

core/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ pub mod autodiff {
247247
pub use crate::macros::builtin::autodiff;
248248
}
249249

250-
#[cfg(not(bootstrap))]
251250
#[unstable(feature = "contracts", issue = "128044")]
252251
pub mod contracts;
253252

core/src/macros/mod.rs

-92
Original file line numberDiff line numberDiff line change
@@ -196,95 +196,6 @@ pub macro assert_matches {
196196
},
197197
}
198198

199-
/// A macro for defining `#[cfg]` match-like statements.
200-
///
201-
/// It is similar to the `if/elif` C preprocessor macro by allowing definition of a cascade of
202-
/// `#[cfg]` cases, emitting the implementation which matches first.
203-
///
204-
/// This allows you to conveniently provide a long list `#[cfg]`'d blocks of code
205-
/// without having to rewrite each clause multiple times.
206-
///
207-
/// Trailing `_` wildcard match arms are **optional** and they indicate a fallback branch when
208-
/// all previous declarations do not evaluate to true.
209-
///
210-
/// # Example
211-
///
212-
/// ```
213-
/// #![feature(cfg_match)]
214-
///
215-
/// cfg_match! {
216-
/// cfg(unix) => {
217-
/// fn foo() { /* unix specific functionality */ }
218-
/// }
219-
/// cfg(target_pointer_width = "32") => {
220-
/// fn foo() { /* non-unix, 32-bit functionality */ }
221-
/// }
222-
/// _ => {
223-
/// fn foo() { /* fallback implementation */ }
224-
/// }
225-
/// }
226-
/// ```
227-
#[cfg(bootstrap)]
228-
#[unstable(feature = "cfg_match", issue = "115585")]
229-
#[rustc_diagnostic_item = "cfg_match"]
230-
pub macro cfg_match {
231-
// with a final wildcard
232-
(
233-
$(cfg($initial_meta:meta) => { $($initial_tokens:tt)* })+
234-
_ => { $($extra_tokens:tt)* }
235-
) => {
236-
cfg_match! {
237-
@__items ();
238-
$((($initial_meta) ($($initial_tokens)*)),)+
239-
(() ($($extra_tokens)*)),
240-
}
241-
},
242-
243-
// without a final wildcard
244-
(
245-
$(cfg($extra_meta:meta) => { $($extra_tokens:tt)* })*
246-
) => {
247-
cfg_match! {
248-
@__items ();
249-
$((($extra_meta) ($($extra_tokens)*)),)*
250-
}
251-
},
252-
253-
// Internal and recursive macro to emit all the items
254-
//
255-
// Collects all the previous cfgs in a list at the beginning, so they can be
256-
// negated. After the semicolon is all the remaining items.
257-
(@__items ($($_:meta,)*);) => {},
258-
(
259-
@__items ($($no:meta,)*);
260-
(($($yes:meta)?) ($($tokens:tt)*)),
261-
$($rest:tt,)*
262-
) => {
263-
// Emit all items within one block, applying an appropriate #[cfg]. The
264-
// #[cfg] will require all `$yes` matchers specified and must also negate
265-
// all previous matchers.
266-
#[cfg(all(
267-
$($yes,)?
268-
not(any($($no),*))
269-
))]
270-
cfg_match! { @__identity $($tokens)* }
271-
272-
// Recurse to emit all other items in `$rest`, and when we do so add all
273-
// our `$yes` matchers to the list of `$no` matchers as future emissions
274-
// will have to negate everything we just matched as well.
275-
cfg_match! {
276-
@__items ($($no,)* $($yes,)?);
277-
$($rest,)*
278-
}
279-
},
280-
281-
// Internal macro to make __apply work out right for different match types,
282-
// because of how macros match/expand stuff.
283-
(@__identity $($tokens:tt)*) => {
284-
$($tokens)*
285-
}
286-
}
287-
288199
/// A macro for defining `#[cfg]` match-like statements.
289200
///
290201
/// It is similar to the `if/elif` C preprocessor macro by allowing definition of a cascade of
@@ -324,7 +235,6 @@ pub macro cfg_match {
324235
/// _ => { "Behind every successful diet is an unwatched pizza" }
325236
/// }};
326237
/// ```
327-
#[cfg(not(bootstrap))]
328238
#[unstable(feature = "cfg_match", issue = "115585")]
329239
#[rustc_diagnostic_item = "cfg_match"]
330240
pub macro cfg_match {
@@ -1782,7 +1692,6 @@ pub(crate) mod builtin {
17821692
/// The attribute carries an argument token-tree which is
17831693
/// eventually parsed as a unary closure expression that is
17841694
/// invoked on a reference to the return value.
1785-
#[cfg(not(bootstrap))]
17861695
#[unstable(feature = "contracts", issue = "128044")]
17871696
#[allow_internal_unstable(contracts_internals)]
17881697
#[rustc_builtin_macro]
@@ -1795,7 +1704,6 @@ pub(crate) mod builtin {
17951704
/// The attribute carries an argument token-tree which is
17961705
/// eventually parsed as an boolean expression with access to the
17971706
/// function's formal parameters
1798-
#[cfg(not(bootstrap))]
17991707
#[unstable(feature = "contracts", issue = "128044")]
18001708
#[allow_internal_unstable(contracts_internals)]
18011709
#[rustc_builtin_macro]

core/src/marker.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ impl<T: ?Sized> Copy for &T {}
467467
///
468468
/// Bikeshed name for now.
469469
#[unstable(feature = "bikeshed_guaranteed_no_drop", issue = "none")]
470-
#[cfg_attr(not(bootstrap), lang = "bikeshed_guaranteed_no_drop")]
470+
#[lang = "bikeshed_guaranteed_no_drop"]
471471
pub trait BikeshedGuaranteedNoDrop {}
472472

473473
/// Types for which it is safe to share references between threads.
@@ -1313,7 +1313,6 @@ pub macro CoercePointee($item:item) {
13131313
///
13141314
/// This trait is not intended to be implemented by users or used other than
13151315
/// validation, so it should never be stabilized.
1316-
#[cfg(not(bootstrap))]
13171316
#[lang = "coerce_pointee_validated"]
13181317
#[unstable(feature = "coerce_pointee_validated", issue = "none")]
13191318
#[doc(hidden)]

core/src/panicking.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ fn panic_misaligned_pointer_dereference(required: usize, found: usize) -> ! {
294294
#[cfg_attr(not(feature = "panic_immediate_abort"), inline(never), cold, optimize(size))]
295295
#[cfg_attr(feature = "panic_immediate_abort", inline)]
296296
#[track_caller]
297-
#[cfg_attr(not(bootstrap), lang = "panic_null_pointer_dereference")] // needed by codegen for panic on null pointer deref
297+
#[lang = "panic_null_pointer_dereference"] // needed by codegen for panic on null pointer deref
298298
#[rustc_nounwind] // `CheckNull` MIR pass requires this function to never unwind
299299
fn panic_null_pointer_dereference() -> ! {
300300
if cfg!(feature = "panic_immediate_abort") {

core/src/range.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pub use crate::ops::{
5050
/// assert_eq!(Range::from(3..5), Range { start: 3, end: 5 });
5151
/// assert_eq!(3 + 4 + 5, Range::from(3..6).into_iter().sum());
5252
/// ```
53-
#[cfg_attr(not(bootstrap), lang = "RangeCopy")]
53+
#[lang = "RangeCopy"]
5454
#[derive(Clone, Copy, Default, PartialEq, Eq, Hash)]
5555
#[unstable(feature = "new_range_api", issue = "125687")]
5656
pub struct Range<Idx> {
@@ -216,7 +216,7 @@ impl<T> From<legacy::Range<T>> for Range<T> {
216216
/// assert_eq!(RangeInclusive::from(3..=5), RangeInclusive { start: 3, end: 5 });
217217
/// assert_eq!(3 + 4 + 5, RangeInclusive::from(3..=5).into_iter().sum());
218218
/// ```
219-
#[cfg_attr(not(bootstrap), lang = "RangeInclusiveCopy")]
219+
#[lang = "RangeInclusiveCopy"]
220220
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
221221
#[unstable(feature = "new_range_api", issue = "125687")]
222222
pub struct RangeInclusive<Idx> {
@@ -408,7 +408,7 @@ impl<T> From<legacy::RangeInclusive<T>> for RangeInclusive<T> {
408408
/// assert_eq!(RangeFrom::from(2..), core::range::RangeFrom { start: 2 });
409409
/// assert_eq!(2 + 3 + 4, RangeFrom::from(2..).into_iter().take(3).sum());
410410
/// ```
411-
#[cfg_attr(not(bootstrap), lang = "RangeFromCopy")]
411+
#[lang = "RangeFromCopy"]
412412
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
413413
#[unstable(feature = "new_range_api", issue = "125687")]
414414
pub struct RangeFrom<Idx> {

coretests/tests/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,7 @@ mod intrinsics;
153153
mod io;
154154
mod iter;
155155
mod lazy;
156-
#[cfg(not(bootstrap))]
157156
mod macros;
158-
#[cfg(bootstrap)]
159-
mod macros_bootstrap;
160157
mod manually_drop;
161158
mod mem;
162159
mod net;

0 commit comments

Comments
 (0)