Skip to content

Commit c605199

Browse files
committed
Auto merge of #67402 - Mark-Simulacrum:stage0-step, r=alexcrichton
Switch bootstrap to 1.41 This updates the version number for master to 1.42 and switches the bootstrap compiler to yesterday's beta. Fallout of cfg(bootstrap) changes is also dealt with.
2 parents 19bd934 + 241d2e7 commit c605199

40 files changed

+172
-543
lines changed

src/bootstrap/channel.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use build_helper::output;
1313
use crate::Build;
1414

1515
// The version number
16-
pub const CFG_RELEASE_NUM: &str = "1.41.0";
16+
pub const CFG_RELEASE_NUM: &str = "1.42.0";
1717

1818
pub struct GitInfo {
1919
inner: Option<Info>,

src/liballoc/collections/linked_list.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,7 @@ impl<T> LinkedList<T> {
275275
/// let list: LinkedList<u32> = LinkedList::new();
276276
/// ```
277277
#[inline]
278-
#[cfg_attr(
279-
not(bootstrap),
280-
rustc_const_stable(feature = "const_linked_list_new", since = "1.32.0"),
281-
)]
278+
#[rustc_const_stable(feature = "const_linked_list_new", since = "1.32.0")]
282279
#[stable(feature = "rust1", since = "1.0.0")]
283280
pub const fn new() -> Self {
284281
LinkedList {

src/liballoc/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,6 @@
116116
#![feature(unsize)]
117117
#![feature(unsized_locals)]
118118
#![feature(allocator_internals)]
119-
#![cfg_attr(bootstrap, feature(on_unimplemented))]
120-
#![cfg_attr(bootstrap, feature(rustc_const_unstable))]
121119
#![feature(slice_partition_dedup)]
122120
#![feature(maybe_uninit_extra, maybe_uninit_slice)]
123121
#![feature(alloc_layout_extra)]

src/liballoc/string.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -367,10 +367,7 @@ impl String {
367367
/// let s = String::new();
368368
/// ```
369369
#[inline]
370-
#[cfg_attr(
371-
not(bootstrap),
372-
rustc_const_stable(feature = "const_string_new", since = "1.32.0"),
373-
)]
370+
#[rustc_const_stable(feature = "const_string_new", since = "1.32.0")]
374371
#[stable(feature = "rust1", since = "1.0.0")]
375372
pub const fn new() -> String {
376373
String { vec: Vec::new() }

src/liballoc/vec.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,7 @@ impl<T> Vec<T> {
315315
/// let mut vec: Vec<i32> = Vec::new();
316316
/// ```
317317
#[inline]
318-
#[cfg_attr(
319-
not(bootstrap),
320-
rustc_const_stable(feature = "const_vec_new", since = "1.32.0"),
321-
)]
318+
#[rustc_const_stable(feature = "const_vec_new", since = "1.32.0")]
322319
#[stable(feature = "rust1", since = "1.0.0")]
323320
pub const fn new() -> Vec<T> {
324321
Vec {

src/libcore/alloc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ impl Layout {
100100
/// This function is unsafe as it does not verify the preconditions from
101101
/// [`Layout::from_size_align`](#method.from_size_align).
102102
#[stable(feature = "alloc_layout", since = "1.28.0")]
103-
#[cfg_attr(not(bootstrap), rustc_const_stable(feature = "alloc_layout", since = "1.28.0"))]
103+
#[rustc_const_stable(feature = "alloc_layout", since = "1.28.0")]
104104
#[inline]
105105
pub const unsafe fn from_size_align_unchecked(size: usize, align: usize) -> Self {
106106
Layout { size_: size, align_: NonZeroUsize::new_unchecked(align) }

src/libcore/any.rs

+3-10
Original file line numberDiff line numberDiff line change
@@ -423,14 +423,9 @@ impl TypeId {
423423
/// assert_eq!(is_string(&"cookie monster".to_string()), true);
424424
/// ```
425425
#[stable(feature = "rust1", since = "1.0.0")]
426-
#[cfg_attr(bootstrap, rustc_const_unstable(feature="const_type_id"))]
427-
#[cfg_attr(not(bootstrap), rustc_const_unstable(feature="const_type_id", issue = "41875"))]
426+
#[rustc_const_unstable(feature="const_type_id", issue = "41875")]
428427
pub const fn of<T: ?Sized + 'static>() -> TypeId {
429428
TypeId {
430-
#[cfg(bootstrap)]
431-
// SAFETY: going away soon
432-
t: unsafe { intrinsics::type_id::<T>() },
433-
#[cfg(not(bootstrap))]
434429
t: intrinsics::type_id::<T>(),
435430
}
436431
}
@@ -462,8 +457,7 @@ impl TypeId {
462457
/// );
463458
/// ```
464459
#[stable(feature = "type_name", since = "1.38.0")]
465-
#[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_type_name"))]
466-
#[cfg_attr(not(bootstrap), rustc_const_unstable(feature = "const_type_name", issue = "63084"))]
460+
#[rustc_const_unstable(feature = "const_type_name", issue = "63084")]
467461
pub const fn type_name<T: ?Sized>() -> &'static str {
468462
intrinsics::type_name::<T>()
469463
}
@@ -501,8 +495,7 @@ pub const fn type_name<T: ?Sized>() -> &'static str {
501495
/// println!("{}", type_name_of_val(&y));
502496
/// ```
503497
#[unstable(feature = "type_name_of_val", issue = "66359")]
504-
#[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_type_name"))]
505-
#[cfg_attr(not(bootstrap), rustc_const_unstable(feature = "const_type_name", issue = "63084"))]
498+
#[rustc_const_unstable(feature = "const_type_name", issue = "63084")]
506499
pub const fn type_name_of_val<T: ?Sized>(val: &T) -> &'static str {
507500
let _ = val;
508501
type_name::<T>()

src/libcore/cell.rs

+5-11
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ impl<T> Cell<T> {
324324
/// let c = Cell::new(5);
325325
/// ```
326326
#[stable(feature = "rust1", since = "1.0.0")]
327-
#[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_cell_new", since = "1.32.0"))]
327+
#[rustc_const_stable(feature = "const_cell_new", since = "1.32.0")]
328328
#[inline]
329329
pub const fn new(value: T) -> Cell<T> {
330330
Cell {
@@ -470,7 +470,7 @@ impl<T: ?Sized> Cell<T> {
470470
/// ```
471471
#[inline]
472472
#[stable(feature = "cell_as_ptr", since = "1.12.0")]
473-
#[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_cell_as_ptr", since = "1.32.0"))]
473+
#[rustc_const_stable(feature = "const_cell_as_ptr", since = "1.32.0")]
474474
pub const fn as_ptr(&self) -> *mut T {
475475
self.value.get()
476476
}
@@ -651,7 +651,7 @@ impl<T> RefCell<T> {
651651
/// let c = RefCell::new(5);
652652
/// ```
653653
#[stable(feature = "rust1", since = "1.0.0")]
654-
#[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_refcell_new", since = "1.32.0"))]
654+
#[rustc_const_stable(feature = "const_refcell_new", since = "1.32.0")]
655655
#[inline]
656656
pub const fn new(value: T) -> RefCell<T> {
657657
RefCell {
@@ -1504,10 +1504,7 @@ impl<T> UnsafeCell<T> {
15041504
/// let uc = UnsafeCell::new(5);
15051505
/// ```
15061506
#[stable(feature = "rust1", since = "1.0.0")]
1507-
#[cfg_attr(
1508-
not(bootstrap),
1509-
rustc_const_stable(feature = "const_unsafe_cell_new", since = "1.32.0"),
1510-
)]
1507+
#[rustc_const_stable(feature = "const_unsafe_cell_new", since = "1.32.0")]
15111508
#[inline]
15121509
pub const fn new(value: T) -> UnsafeCell<T> {
15131510
UnsafeCell { value }
@@ -1550,10 +1547,7 @@ impl<T: ?Sized> UnsafeCell<T> {
15501547
/// ```
15511548
#[inline]
15521549
#[stable(feature = "rust1", since = "1.0.0")]
1553-
#[cfg_attr(
1554-
not(bootstrap),
1555-
rustc_const_stable(feature = "const_unsafecell_get", since = "1.32.0"),
1556-
)]
1550+
#[rustc_const_stable(feature = "const_unsafecell_get", since = "1.32.0")]
15571551
pub const fn get(&self) -> *mut T {
15581552
// We can just cast the pointer from `UnsafeCell<T>` to `T` because of
15591553
// #[repr(transparent)]. This exploits libstd's special status, there is

src/libcore/char/methods.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -911,10 +911,7 @@ impl char {
911911
/// assert!(!non_ascii.is_ascii());
912912
/// ```
913913
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
914-
#[cfg_attr(
915-
not(bootstrap),
916-
rustc_const_stable(feature = "const_ascii_methods_on_intrinsics", since = "1.32.0"),
917-
)]
914+
#[rustc_const_stable(feature = "const_ascii_methods_on_intrinsics", since = "1.32.0")]
918915
#[inline]
919916
pub const fn is_ascii(&self) -> bool {
920917
*self as u32 <= 0x7F

src/libcore/convert/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ pub use num::FloatToInt;
101101
/// assert_eq!(vec![1, 3], filtered);
102102
/// ```
103103
#[stable(feature = "convert_id", since = "1.33.0")]
104-
#[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_identity", since = "1.33.0"))]
104+
#[rustc_const_stable(feature = "const_identity", since = "1.33.0")]
105105
#[inline]
106106
pub const fn identity<T>(x: T) -> T {
107107
x

src/libcore/convert/num.rs

-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ mod private {
1313
/// Typically doesn’t need to be used directly.
1414
#[unstable(feature = "convert_float_to_int", issue = "67057")]
1515
pub trait FloatToInt<Int>: private::Sealed + Sized {
16-
#[cfg(not(bootstrap))]
1716
#[unstable(feature = "float_approx_unchecked_to", issue = "67058")]
1817
#[doc(hidden)]
1918
unsafe fn approx_unchecked(self) -> Int;
@@ -26,7 +25,6 @@ macro_rules! impl_float_to_int {
2625
$(
2726
#[unstable(feature = "convert_float_to_int", issue = "67057")]
2827
impl FloatToInt<$Int> for $Float {
29-
#[cfg(not(bootstrap))]
3028
#[doc(hidden)]
3129
#[inline]
3230
unsafe fn approx_unchecked(self) -> $Int {

src/libcore/intrinsics.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -939,11 +939,7 @@ extern "rust-intrinsic" {
939939
/// }
940940
/// ```
941941
#[stable(feature = "rust1", since = "1.0.0")]
942-
#[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_transmute"))]
943-
#[cfg_attr(
944-
not(bootstrap),
945-
rustc_const_unstable(feature = "const_transmute", issue = "53605"),
946-
)]
942+
#[rustc_const_unstable(feature = "const_transmute", issue = "53605")]
947943
pub fn transmute<T, U>(e: T) -> U;
948944

949945
/// Returns `true` if the actual type given as `T` requires drop
@@ -1150,7 +1146,6 @@ extern "rust-intrinsic" {
11501146

11511147
/// Convert with LLVM’s fptoui/fptosi, which may return undef for values out of range
11521148
/// https://github.com/rust-lang/rust/issues/10184
1153-
#[cfg(not(bootstrap))]
11541149
pub fn float_to_int_approx_unchecked<Float, Int>(value: Float) -> Int;
11551150

11561151

@@ -1361,7 +1356,6 @@ extern "rust-intrinsic" {
13611356
/// Compiles to a NOP during non-Miri codegen.
13621357
///
13631358
/// Perma-unstable: do not use
1364-
#[cfg(not(bootstrap))]
13651359
pub fn miri_start_panic(data: *mut (dyn crate::any::Any + crate::marker::Send)) -> ();
13661360
}
13671361

src/libcore/iter/adapters/mod.rs

-8
Original file line numberDiff line numberDiff line change
@@ -517,14 +517,6 @@ impl<I> Iterator for StepBy<I> where I: Iterator {
517517
// overflow handling
518518
loop {
519519
let mul = n.checked_mul(step);
520-
#[cfg(bootstrap)]
521-
{
522-
// SAFETY: going away soon
523-
if unsafe { intrinsics::likely(mul.is_some()) } {
524-
return self.iter.nth(mul.unwrap() - 1);
525-
}
526-
}
527-
#[cfg(not(bootstrap))]
528520
{
529521
if intrinsics::likely(mul.is_some()) {
530522
return self.iter.nth(mul.unwrap() - 1);

src/libcore/iter/sources.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ impl<T> Default for Empty<T> {
281281
/// assert_eq!(None, nope.next());
282282
/// ```
283283
#[stable(feature = "iter_empty", since = "1.2.0")]
284-
#[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_iter_empty", since = "1.32.0"))]
284+
#[rustc_const_stable(feature = "const_iter_empty", since = "1.32.0")]
285285
pub const fn empty<T>() -> Empty<T> {
286286
Empty(marker::PhantomData)
287287
}

src/libcore/lib.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@
7474
#![feature(const_fn)]
7575
#![feature(const_fn_union)]
7676
#![feature(const_generics)]
77-
#![cfg_attr(not(bootstrap), feature(const_ptr_offset_from))]
78-
#![cfg_attr(not(bootstrap), feature(const_type_name))]
77+
#![feature(const_ptr_offset_from)]
78+
#![feature(const_type_name)]
7979
#![feature(custom_inner_attributes)]
8080
#![feature(decl_macro)]
8181
#![feature(doc_cfg)]
@@ -91,18 +91,16 @@
9191
#![feature(nll)]
9292
#![feature(exhaustive_patterns)]
9393
#![feature(no_core)]
94-
#![cfg_attr(bootstrap, feature(on_unimplemented))]
9594
#![feature(optin_builtin_traits)]
9695
#![feature(prelude_import)]
9796
#![feature(repr_simd, platform_intrinsics)]
9897
#![feature(rustc_attrs)]
99-
#![cfg_attr(bootstrap, feature(rustc_const_unstable))]
10098
#![feature(simd_ffi)]
10199
#![feature(specialization)]
102100
#![feature(staged_api)]
103101
#![feature(std_internals)]
104102
#![feature(stmt_expr_attributes)]
105-
#![cfg_attr(not(bootstrap), feature(track_caller))]
103+
#![feature(track_caller)]
106104
#![feature(transparent_unions)]
107105
#![feature(unboxed_closures)]
108106
#![feature(unsized_locals)]

src/libcore/mem/manually_drop.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,7 @@ impl<T> ManuallyDrop<T> {
6363
/// ManuallyDrop::new(Box::new(()));
6464
/// ```
6565
#[stable(feature = "manually_drop", since = "1.20.0")]
66-
#[cfg_attr(
67-
not(bootstrap),
68-
rustc_const_stable(feature = "const_manually_drop", since = "1.36.0"),
69-
)]
66+
#[rustc_const_stable(feature = "const_manually_drop", since = "1.36.0")]
7067
#[inline(always)]
7168
pub const fn new(value: T) -> ManuallyDrop<T> {
7269
ManuallyDrop { value }
@@ -84,10 +81,7 @@ impl<T> ManuallyDrop<T> {
8481
/// let _: Box<()> = ManuallyDrop::into_inner(x); // This drops the `Box`.
8582
/// ```
8683
#[stable(feature = "manually_drop", since = "1.20.0")]
87-
#[cfg_attr(
88-
not(bootstrap),
89-
rustc_const_stable(feature = "const_manually_drop", since = "1.36.0"),
90-
)]
84+
#[rustc_const_stable(feature = "const_manually_drop", since = "1.36.0")]
9185
#[inline(always)]
9286
pub const fn into_inner(slot: ManuallyDrop<T>) -> T {
9387
slot.value

src/libcore/mem/maybe_uninit.rs

+5-11
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,7 @@ impl<T> MaybeUninit<T> {
250250
///
251251
/// [`assume_init`]: #method.assume_init
252252
#[stable(feature = "maybe_uninit", since = "1.36.0")]
253-
#[cfg_attr(
254-
not(bootstrap),
255-
rustc_const_stable(feature = "const_maybe_uninit", since = "1.36.0"),
256-
)]
253+
#[rustc_const_stable(feature = "const_maybe_uninit", since = "1.36.0")]
257254
#[inline(always)]
258255
pub const fn new(val: T) -> MaybeUninit<T> {
259256
MaybeUninit { value: ManuallyDrop::new(val) }
@@ -268,12 +265,9 @@ impl<T> MaybeUninit<T> {
268265
///
269266
/// [type]: union.MaybeUninit.html
270267
#[stable(feature = "maybe_uninit", since = "1.36.0")]
271-
#[cfg_attr(
272-
not(bootstrap),
273-
rustc_const_stable(feature = "const_maybe_uninit", since = "1.36.0"),
274-
)]
268+
#[rustc_const_stable(feature = "const_maybe_uninit", since = "1.36.0")]
275269
#[inline(always)]
276-
#[cfg_attr(all(not(bootstrap)), rustc_diagnostic_item = "maybe_uninit_uninit")]
270+
#[rustc_diagnostic_item = "maybe_uninit_uninit"]
277271
pub const fn uninit() -> MaybeUninit<T> {
278272
MaybeUninit { uninit: () }
279273
}
@@ -357,7 +351,7 @@ impl<T> MaybeUninit<T> {
357351
/// ```
358352
#[stable(feature = "maybe_uninit", since = "1.36.0")]
359353
#[inline]
360-
#[cfg_attr(all(not(bootstrap)), rustc_diagnostic_item = "maybe_uninit_zeroed")]
354+
#[rustc_diagnostic_item = "maybe_uninit_zeroed"]
361355
pub fn zeroed() -> MaybeUninit<T> {
362356
let mut u = MaybeUninit::<T>::uninit();
363357
unsafe {
@@ -498,7 +492,7 @@ impl<T> MaybeUninit<T> {
498492
/// ```
499493
#[stable(feature = "maybe_uninit", since = "1.36.0")]
500494
#[inline(always)]
501-
#[cfg_attr(all(not(bootstrap)), rustc_diagnostic_item = "assume_init")]
495+
#[rustc_diagnostic_item = "assume_init"]
502496
pub unsafe fn assume_init(self) -> T {
503497
intrinsics::panic_if_uninhabited::<T>();
504498
ManuallyDrop::into_inner(self.value)

0 commit comments

Comments
 (0)