Skip to content

Commit a0d664b

Browse files
committed
Auto merge of #79219 - shepmaster:beta-bump, r=Mark-Simulacrum
Bump bootstrap compiler version r? `@Mark-Simulacrum` /cc `@pietroalbini`
2 parents c643dd2 + dcef5ff commit a0d664b

File tree

18 files changed

+29
-64
lines changed

18 files changed

+29
-64
lines changed

library/alloc/src/alloc.rs

+2-17
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ extern "Rust" {
358358
/// [`set_alloc_error_hook`]: ../../std/alloc/fn.set_alloc_error_hook.html
359359
/// [`take_alloc_error_hook`]: ../../std/alloc/fn.take_alloc_error_hook.html
360360
#[stable(feature = "global_alloc", since = "1.28.0")]
361-
#[cfg(not(any(test, bootstrap)))]
361+
#[cfg(not(test))]
362362
#[rustc_allocator_nounwind]
363363
pub fn handle_alloc_error(layout: Layout) -> ! {
364364
unsafe {
@@ -370,22 +370,7 @@ pub fn handle_alloc_error(layout: Layout) -> ! {
370370
#[cfg(test)]
371371
pub use std::alloc::handle_alloc_error;
372372

373-
// In stage0 (bootstrap) `__rust_alloc_error_handler`,
374-
// might not be generated yet, because an old compiler is used,
375-
// so use the old direct call.
376-
#[cfg(all(bootstrap, not(test)))]
377-
#[stable(feature = "global_alloc", since = "1.28.0")]
378-
#[doc(hidden)]
379-
#[rustc_allocator_nounwind]
380-
pub fn handle_alloc_error(layout: Layout) -> ! {
381-
extern "Rust" {
382-
#[lang = "oom"]
383-
fn oom_impl(layout: Layout) -> !;
384-
}
385-
unsafe { oom_impl(layout) }
386-
}
387-
388-
#[cfg(not(any(target_os = "hermit", test, bootstrap)))]
373+
#[cfg(not(any(target_os = "hermit", test)))]
389374
#[doc(hidden)]
390375
#[allow(unused_attributes)]
391376
#[unstable(feature = "alloc_internals", issue = "none")]

library/alloc/src/lib.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
#![allow(explicit_outlives_requirements)]
7373
#![allow(incomplete_features)]
7474
#![deny(unsafe_op_in_unsafe_fn)]
75-
#![cfg_attr(not(bootstrap), feature(rustc_allow_const_fn_unstable))]
75+
#![feature(rustc_allow_const_fn_unstable)]
7676
#![cfg_attr(not(test), feature(generator_trait))]
7777
#![cfg_attr(test, feature(test))]
7878
#![cfg_attr(test, feature(new_uninit))]
@@ -130,8 +130,7 @@
130130
#![feature(unicode_internals)]
131131
#![feature(unsafe_block_in_unsafe_fn)]
132132
#![feature(unsize)]
133-
#![cfg_attr(not(bootstrap), feature(unsized_fn_params))]
134-
#![cfg_attr(bootstrap, feature(unsized_locals))]
133+
#![feature(unsized_fn_params)]
135134
#![feature(allocator_internals)]
136135
#![feature(slice_partition_dedup)]
137136
#![feature(maybe_uninit_extra, maybe_uninit_slice, maybe_uninit_uninit_array)]

library/alloc/src/raw_vec.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@ impl<T> RawVec<T, Global> {
116116
impl<T, A: AllocRef> RawVec<T, A> {
117117
/// Like `new`, but parameterized over the choice of allocator for
118118
/// the returned `RawVec`.
119-
#[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn))]
120-
#[cfg_attr(bootstrap, allow_internal_unstable(const_fn))]
119+
#[rustc_allow_const_fn_unstable(const_fn)]
121120
pub const fn new_in(alloc: A) -> Self {
122121
// `cap: 0` means "unallocated". zero-sized types are ignored.
123122
Self { ptr: Unique::dangling(), cap: 0, alloc }

library/core/src/lib.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
#![warn(missing_debug_implementations)]
6464
#![allow(explicit_outlives_requirements)]
6565
#![allow(incomplete_features)]
66-
#![cfg_attr(not(bootstrap), feature(rustc_allow_const_fn_unstable))]
66+
#![feature(rustc_allow_const_fn_unstable)]
6767
#![feature(allow_internal_unstable)]
6868
#![feature(arbitrary_self_types)]
6969
#![feature(asm)]
@@ -85,7 +85,7 @@
8585
#![feature(const_pin)]
8686
#![feature(const_fn)]
8787
#![feature(const_fn_union)]
88-
#![cfg_attr(not(bootstrap), feature(const_impl_trait))]
88+
#![feature(const_impl_trait)]
8989
#![feature(const_fn_floating_point_arithmetic)]
9090
#![feature(const_fn_fn_ptr_basics)]
9191
#![feature(const_generics)]
@@ -134,9 +134,7 @@
134134
#![feature(transparent_unions)]
135135
#![feature(try_blocks)]
136136
#![feature(unboxed_closures)]
137-
#![cfg_attr(not(bootstrap), feature(unsized_fn_params))]
138-
#![cfg_attr(bootstrap, feature(unsized_locals))]
139-
#![cfg_attr(bootstrap, feature(untagged_unions))]
137+
#![feature(unsized_fn_params)]
140138
#![feature(unwind_attributes)]
141139
#![feature(variant_count)]
142140
#![feature(tbm_target_feature)]
@@ -290,7 +288,7 @@ pub mod primitive;
290288
unused_imports,
291289
unsafe_op_in_unsafe_fn
292290
)]
293-
#[cfg_attr(not(bootstrap), allow(non_autolinks))]
291+
#[allow(non_autolinks)]
294292
// FIXME: This annotation should be moved into rust-lang/stdarch after clashing_extern_declarations is
295293
// merged. It currently cannot because bootstrap fails as the lint hasn't been defined yet.
296294
#[allow(clashing_extern_declarations)]

library/core/src/num/int_macros.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -2047,8 +2047,7 @@ assert_eq!(
20472047
#[rustc_const_stable(feature = "const_int_conversion", since = "1.44.0")]
20482048
// SAFETY: const sound because integers are plain old datatypes so we can always
20492049
// transmute them to arrays of bytes
2050-
#[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn_transmute))]
2051-
#[cfg_attr(bootstrap, allow_internal_unstable(const_fn_transmute))]
2050+
#[rustc_allow_const_fn_unstable(const_fn_transmute)]
20522051
#[inline]
20532052
pub const fn to_ne_bytes(self) -> [u8; mem::size_of::<Self>()] {
20542053
// SAFETY: integers are plain old datatypes so we can always transmute them to
@@ -2196,8 +2195,7 @@ fn read_ne_", stringify!($SelfT), "(input: &mut &[u8]) -> ", stringify!($SelfT),
21962195
#[rustc_const_stable(feature = "const_int_conversion", since = "1.44.0")]
21972196
// SAFETY: const sound because integers are plain old datatypes so we can always
21982197
// transmute to them
2199-
#[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn_transmute))]
2200-
#[cfg_attr(bootstrap, allow_internal_unstable(const_fn_transmute))]
2198+
#[rustc_allow_const_fn_unstable(const_fn_transmute)]
22012199
#[inline]
22022200
pub const fn from_ne_bytes(bytes: [u8; mem::size_of::<Self>()]) -> Self {
22032201
// SAFETY: integers are plain old datatypes so we can always transmute to them

library/core/src/num/uint_macros.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1805,8 +1805,7 @@ assert_eq!(
18051805
#[rustc_const_stable(feature = "const_int_conversion", since = "1.44.0")]
18061806
// SAFETY: const sound because integers are plain old datatypes so we can always
18071807
// transmute them to arrays of bytes
1808-
#[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn_transmute))]
1809-
#[cfg_attr(bootstrap, allow_internal_unstable(const_fn_transmute))]
1808+
#[rustc_allow_const_fn_unstable(const_fn_transmute)]
18101809
#[inline]
18111810
pub const fn to_ne_bytes(self) -> [u8; mem::size_of::<Self>()] {
18121811
// SAFETY: integers are plain old datatypes so we can always transmute them to
@@ -1954,8 +1953,7 @@ fn read_ne_", stringify!($SelfT), "(input: &mut &[u8]) -> ", stringify!($SelfT),
19541953
#[rustc_const_stable(feature = "const_int_conversion", since = "1.44.0")]
19551954
// SAFETY: const sound because integers are plain old datatypes so we can always
19561955
// transmute to them
1957-
#[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn_transmute))]
1958-
#[cfg_attr(bootstrap, allow_internal_unstable(const_fn_transmute))]
1956+
#[rustc_allow_const_fn_unstable(const_fn_transmute)]
19591957
#[inline]
19601958
pub const fn from_ne_bytes(bytes: [u8; mem::size_of::<Self>()]) -> Self {
19611959
// SAFETY: integers are plain old datatypes so we can always transmute to them

library/core/src/panicking.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub fn panic(expr: &'static str) -> ! {
5252

5353
#[inline]
5454
#[track_caller]
55-
#[cfg_attr(not(bootstrap), lang = "panic_str")] // needed for const-evaluated panics
55+
#[lang = "panic_str"] // needed for const-evaluated panics
5656
pub fn panic_str(expr: &str) -> ! {
5757
panic_fmt(format_args!("{}", expr));
5858
}

library/core/src/slice/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ impl<T> [T] {
8888
#[rustc_const_stable(feature = "const_slice_len", since = "1.32.0")]
8989
#[inline]
9090
// SAFETY: const sound because we transmute out the length field as a usize (which it must be)
91-
#[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn_union))]
92-
#[cfg_attr(bootstrap, allow_internal_unstable(const_fn_union))]
91+
#[rustc_allow_const_fn_unstable(const_fn_union)]
9392
pub const fn len(&self) -> usize {
9493
// SAFETY: this is safe because `&[T]` and `FatPtr<T>` have the same layout.
9594
// Only `std` can make this guarantee.

library/core/src/str/converts.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,7 @@ pub fn from_utf8_mut(v: &mut [u8]) -> Result<&mut str, Utf8Error> {
157157
#[inline]
158158
#[stable(feature = "rust1", since = "1.0.0")]
159159
#[rustc_const_unstable(feature = "const_str_from_utf8_unchecked", issue = "75196")]
160-
#[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn_transmute))]
161-
#[cfg_attr(bootstrap, allow_internal_unstable(const_fn_transmute))]
160+
#[rustc_allow_const_fn_unstable(const_fn_transmute)]
162161
pub const unsafe fn from_utf8_unchecked(v: &[u8]) -> &str {
163162
// SAFETY: the caller must guarantee that the bytes `v` are valid UTF-8.
164163
// Also relies on `&str` and `&[u8]` having the same layout.

library/core/src/str/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,7 @@ impl str {
219219
#[rustc_const_stable(feature = "str_as_bytes", since = "1.32.0")]
220220
#[inline(always)]
221221
#[allow(unused_attributes)]
222-
#[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn_transmute))]
223-
#[cfg_attr(bootstrap, allow_internal_unstable(const_fn_transmute))]
222+
#[rustc_allow_const_fn_unstable(const_fn_transmute)]
224223
pub const fn as_bytes(&self) -> &[u8] {
225224
// SAFETY: const sound because we transmute two types with the same layout
226225
unsafe { mem::transmute(self) }

library/core/src/task/wake.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@ impl RawWakerVTable {
130130
#[rustc_promotable]
131131
#[stable(feature = "futures_api", since = "1.36.0")]
132132
#[rustc_const_stable(feature = "futures_api", since = "1.36.0")]
133-
#[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn_fn_ptr_basics))]
134-
#[cfg_attr(bootstrap, allow_internal_unstable(const_fn_fn_ptr_basics))]
133+
#[rustc_allow_const_fn_unstable(const_fn_fn_ptr_basics)]
135134
pub const fn new(
136135
clone: unsafe fn(*const ()) -> RawWaker,
137136
wake: unsafe fn(*const ()),

library/proc_macro/src/bridge/client.rs

+5-10
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,7 @@ fn run_client<A: for<'a, 's> DecodeMut<'a, 's, ()>, R: Encode<()>>(
401401
}
402402

403403
impl Client<fn(crate::TokenStream) -> crate::TokenStream> {
404-
#[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn))]
405-
#[cfg_attr(bootstrap, allow_internal_unstable(const_fn))]
404+
#[rustc_allow_const_fn_unstable(const_fn)]
406405
pub const fn expand1(f: fn(crate::TokenStream) -> crate::TokenStream) -> Self {
407406
extern "C" fn run(
408407
bridge: Bridge<'_>,
@@ -415,8 +414,7 @@ impl Client<fn(crate::TokenStream) -> crate::TokenStream> {
415414
}
416415

417416
impl Client<fn(crate::TokenStream, crate::TokenStream) -> crate::TokenStream> {
418-
#[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn))]
419-
#[cfg_attr(bootstrap, allow_internal_unstable(const_fn))]
417+
#[rustc_allow_const_fn_unstable(const_fn)]
420418
pub const fn expand2(
421419
f: fn(crate::TokenStream, crate::TokenStream) -> crate::TokenStream,
422420
) -> Self {
@@ -461,8 +459,7 @@ impl ProcMacro {
461459
}
462460
}
463461

464-
#[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn))]
465-
#[cfg_attr(bootstrap, allow_internal_unstable(const_fn))]
462+
#[rustc_allow_const_fn_unstable(const_fn)]
466463
pub const fn custom_derive(
467464
trait_name: &'static str,
468465
attributes: &'static [&'static str],
@@ -471,17 +468,15 @@ impl ProcMacro {
471468
ProcMacro::CustomDerive { trait_name, attributes, client: Client::expand1(expand) }
472469
}
473470

474-
#[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn))]
475-
#[cfg_attr(bootstrap, allow_internal_unstable(const_fn))]
471+
#[rustc_allow_const_fn_unstable(const_fn)]
476472
pub const fn attr(
477473
name: &'static str,
478474
expand: fn(crate::TokenStream, crate::TokenStream) -> crate::TokenStream,
479475
) -> Self {
480476
ProcMacro::Attr { name, client: Client::expand2(expand) }
481477
}
482478

483-
#[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn))]
484-
#[cfg_attr(bootstrap, allow_internal_unstable(const_fn))]
479+
#[rustc_allow_const_fn_unstable(const_fn)]
485480
pub const fn bang(
486481
name: &'static str,
487482
expand: fn(crate::TokenStream) -> crate::TokenStream,

library/proc_macro/src/bridge/scoped_cell.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ impl<'a, 'b, T: LambdaL> DerefMut for RefMutL<'a, 'b, T> {
3535
pub struct ScopedCell<T: LambdaL>(Cell<<T as ApplyL<'static>>::Out>);
3636

3737
impl<T: LambdaL> ScopedCell<T> {
38-
#[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn))]
39-
#[cfg_attr(bootstrap, allow_internal_unstable(const_fn))]
38+
#[rustc_allow_const_fn_unstable(const_fn)]
4039
pub const fn new(value: <T as ApplyL<'static>>::Out) -> Self {
4140
ScopedCell(Cell::new(value))
4241
}

library/proc_macro/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
test(no_crate_inject, attr(deny(warnings))),
1919
test(attr(allow(dead_code, deprecated, unused_variables, unused_mut)))
2020
)]
21-
#![cfg_attr(not(bootstrap), feature(rustc_allow_const_fn_unstable))]
21+
#![feature(rustc_allow_const_fn_unstable)]
2222
#![feature(nll)]
2323
#![feature(staged_api)]
2424
#![feature(const_fn)]

library/std/src/ffi/c_str.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1266,7 +1266,7 @@ impl CStr {
12661266
/// behavior when `ptr` is used inside the `unsafe` block:
12671267
///
12681268
/// ```no_run
1269-
/// # #![allow(unused_must_use)] #![cfg_attr(not(bootstrap), allow(temporary_cstring_as_ptr))]
1269+
/// # #![allow(unused_must_use)] #![allow(temporary_cstring_as_ptr)]
12701270
/// use std::ffi::CString;
12711271
///
12721272
/// let ptr = CString::new("Hello").expect("CString::new failed").as_ptr();

library/std/src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@
206206
#![needs_panic_runtime]
207207
// std may use features in a platform-specific way
208208
#![allow(unused_features)]
209-
#![cfg_attr(not(bootstrap), feature(rustc_allow_const_fn_unstable))]
209+
#![feature(rustc_allow_const_fn_unstable)]
210210
#![cfg_attr(test, feature(internal_output_capture, print_internals, update_panic_count))]
211211
#![cfg_attr(
212212
all(target_vendor = "fortanix", target_env = "sgx"),
@@ -323,7 +323,6 @@
323323
#![feature(unsafe_block_in_unsafe_fn)]
324324
#![feature(unsafe_cell_get_mut)]
325325
#![feature(unsafe_cell_raw_get)]
326-
#![cfg_attr(bootstrap, feature(untagged_unions))]
327326
#![feature(unwind_attributes)]
328327
#![feature(vec_into_raw_parts)]
329328
#![feature(wake_trait)]

library/std/src/net/ip.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1043,8 +1043,7 @@ impl Ipv6Addr {
10431043
/// ```
10441044
#[stable(feature = "rust1", since = "1.0.0")]
10451045
#[rustc_const_stable(feature = "const_ipv6", since = "1.32.0")]
1046-
#[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn_transmute))]
1047-
#[cfg_attr(bootstrap, allow_internal_unstable(const_fn_transmute))]
1046+
#[rustc_allow_const_fn_unstable(const_fn_transmute)]
10481047
pub const fn new(a: u16, b: u16, c: u16, d: u16, e: u16, f: u16, g: u16, h: u16) -> Ipv6Addr {
10491048
let addr16 = [
10501049
a.to_be(),

src/stage0.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# stable release's version number. `date` is the date where the release we're
1313
# bootstrapping off was released.
1414

15-
date: 2020-10-16
15+
date: 2020-11-18
1616
rustc: beta
1717

1818
# We use a nightly rustfmt to format the source because it solves some

0 commit comments

Comments
 (0)