1
Fork 0

Bump bootstrap compiler version

This commit is contained in:
Jake Goulding 2020-11-19 15:01:48 -05:00
parent 3d3c8c5e0d
commit dcef5ff372
18 changed files with 29 additions and 64 deletions

View file

@ -358,7 +358,7 @@ extern "Rust" {
/// [`set_alloc_error_hook`]: ../../std/alloc/fn.set_alloc_error_hook.html /// [`set_alloc_error_hook`]: ../../std/alloc/fn.set_alloc_error_hook.html
/// [`take_alloc_error_hook`]: ../../std/alloc/fn.take_alloc_error_hook.html /// [`take_alloc_error_hook`]: ../../std/alloc/fn.take_alloc_error_hook.html
#[stable(feature = "global_alloc", since = "1.28.0")] #[stable(feature = "global_alloc", since = "1.28.0")]
#[cfg(not(any(test, bootstrap)))] #[cfg(not(test))]
#[rustc_allocator_nounwind] #[rustc_allocator_nounwind]
pub fn handle_alloc_error(layout: Layout) -> ! { pub fn handle_alloc_error(layout: Layout) -> ! {
unsafe { unsafe {
@ -370,22 +370,7 @@ pub fn handle_alloc_error(layout: Layout) -> ! {
#[cfg(test)] #[cfg(test)]
pub use std::alloc::handle_alloc_error; pub use std::alloc::handle_alloc_error;
// In stage0 (bootstrap) `__rust_alloc_error_handler`, #[cfg(not(any(target_os = "hermit", test)))]
// might not be generated yet, because an old compiler is used,
// so use the old direct call.
#[cfg(all(bootstrap, not(test)))]
#[stable(feature = "global_alloc", since = "1.28.0")]
#[doc(hidden)]
#[rustc_allocator_nounwind]
pub fn handle_alloc_error(layout: Layout) -> ! {
extern "Rust" {
#[lang = "oom"]
fn oom_impl(layout: Layout) -> !;
}
unsafe { oom_impl(layout) }
}
#[cfg(not(any(target_os = "hermit", test, bootstrap)))]
#[doc(hidden)] #[doc(hidden)]
#[allow(unused_attributes)] #[allow(unused_attributes)]
#[unstable(feature = "alloc_internals", issue = "none")] #[unstable(feature = "alloc_internals", issue = "none")]

View file

@ -72,7 +72,7 @@
#![allow(explicit_outlives_requirements)] #![allow(explicit_outlives_requirements)]
#![allow(incomplete_features)] #![allow(incomplete_features)]
#![deny(unsafe_op_in_unsafe_fn)] #![deny(unsafe_op_in_unsafe_fn)]
#![cfg_attr(not(bootstrap), feature(rustc_allow_const_fn_unstable))] #![feature(rustc_allow_const_fn_unstable)]
#![cfg_attr(not(test), feature(generator_trait))] #![cfg_attr(not(test), feature(generator_trait))]
#![cfg_attr(test, feature(test))] #![cfg_attr(test, feature(test))]
#![cfg_attr(test, feature(new_uninit))] #![cfg_attr(test, feature(new_uninit))]
@ -130,8 +130,7 @@
#![feature(unicode_internals)] #![feature(unicode_internals)]
#![feature(unsafe_block_in_unsafe_fn)] #![feature(unsafe_block_in_unsafe_fn)]
#![feature(unsize)] #![feature(unsize)]
#![cfg_attr(not(bootstrap), feature(unsized_fn_params))] #![feature(unsized_fn_params)]
#![cfg_attr(bootstrap, feature(unsized_locals))]
#![feature(allocator_internals)] #![feature(allocator_internals)]
#![feature(slice_partition_dedup)] #![feature(slice_partition_dedup)]
#![feature(maybe_uninit_extra, maybe_uninit_slice, maybe_uninit_uninit_array)] #![feature(maybe_uninit_extra, maybe_uninit_slice, maybe_uninit_uninit_array)]

View file

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

View file

@ -63,7 +63,7 @@
#![warn(missing_debug_implementations)] #![warn(missing_debug_implementations)]
#![allow(explicit_outlives_requirements)] #![allow(explicit_outlives_requirements)]
#![allow(incomplete_features)] #![allow(incomplete_features)]
#![cfg_attr(not(bootstrap), feature(rustc_allow_const_fn_unstable))] #![feature(rustc_allow_const_fn_unstable)]
#![feature(allow_internal_unstable)] #![feature(allow_internal_unstable)]
#![feature(arbitrary_self_types)] #![feature(arbitrary_self_types)]
#![feature(asm)] #![feature(asm)]
@ -85,7 +85,7 @@
#![feature(const_pin)] #![feature(const_pin)]
#![feature(const_fn)] #![feature(const_fn)]
#![feature(const_fn_union)] #![feature(const_fn_union)]
#![cfg_attr(not(bootstrap), feature(const_impl_trait))] #![feature(const_impl_trait)]
#![feature(const_fn_floating_point_arithmetic)] #![feature(const_fn_floating_point_arithmetic)]
#![feature(const_fn_fn_ptr_basics)] #![feature(const_fn_fn_ptr_basics)]
#![feature(const_generics)] #![feature(const_generics)]
@ -134,9 +134,7 @@
#![feature(transparent_unions)] #![feature(transparent_unions)]
#![feature(try_blocks)] #![feature(try_blocks)]
#![feature(unboxed_closures)] #![feature(unboxed_closures)]
#![cfg_attr(not(bootstrap), feature(unsized_fn_params))] #![feature(unsized_fn_params)]
#![cfg_attr(bootstrap, feature(unsized_locals))]
#![cfg_attr(bootstrap, feature(untagged_unions))]
#![feature(unwind_attributes)] #![feature(unwind_attributes)]
#![feature(variant_count)] #![feature(variant_count)]
#![feature(tbm_target_feature)] #![feature(tbm_target_feature)]
@ -290,7 +288,7 @@ pub mod primitive;
unused_imports, unused_imports,
unsafe_op_in_unsafe_fn unsafe_op_in_unsafe_fn
)] )]
#[cfg_attr(not(bootstrap), allow(non_autolinks))] #[allow(non_autolinks)]
// FIXME: This annotation should be moved into rust-lang/stdarch after clashing_extern_declarations is // FIXME: This annotation should be moved into rust-lang/stdarch after clashing_extern_declarations is
// merged. It currently cannot because bootstrap fails as the lint hasn't been defined yet. // merged. It currently cannot because bootstrap fails as the lint hasn't been defined yet.
#[allow(clashing_extern_declarations)] #[allow(clashing_extern_declarations)]

View file

@ -2047,8 +2047,7 @@ assert_eq!(
#[rustc_const_stable(feature = "const_int_conversion", since = "1.44.0")] #[rustc_const_stable(feature = "const_int_conversion", since = "1.44.0")]
// SAFETY: const sound because integers are plain old datatypes so we can always // SAFETY: const sound because integers are plain old datatypes so we can always
// transmute them to arrays of bytes // transmute them to arrays of bytes
#[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn_transmute))] #[rustc_allow_const_fn_unstable(const_fn_transmute)]
#[cfg_attr(bootstrap, allow_internal_unstable(const_fn_transmute))]
#[inline] #[inline]
pub const fn to_ne_bytes(self) -> [u8; mem::size_of::<Self>()] { pub const fn to_ne_bytes(self) -> [u8; mem::size_of::<Self>()] {
// SAFETY: integers are plain old datatypes so we can always transmute them to // 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),
#[rustc_const_stable(feature = "const_int_conversion", since = "1.44.0")] #[rustc_const_stable(feature = "const_int_conversion", since = "1.44.0")]
// SAFETY: const sound because integers are plain old datatypes so we can always // SAFETY: const sound because integers are plain old datatypes so we can always
// transmute to them // transmute to them
#[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn_transmute))] #[rustc_allow_const_fn_unstable(const_fn_transmute)]
#[cfg_attr(bootstrap, allow_internal_unstable(const_fn_transmute))]
#[inline] #[inline]
pub const fn from_ne_bytes(bytes: [u8; mem::size_of::<Self>()]) -> Self { pub const fn from_ne_bytes(bytes: [u8; mem::size_of::<Self>()]) -> Self {
// SAFETY: integers are plain old datatypes so we can always transmute to them // SAFETY: integers are plain old datatypes so we can always transmute to them

View file

@ -1805,8 +1805,7 @@ assert_eq!(
#[rustc_const_stable(feature = "const_int_conversion", since = "1.44.0")] #[rustc_const_stable(feature = "const_int_conversion", since = "1.44.0")]
// SAFETY: const sound because integers are plain old datatypes so we can always // SAFETY: const sound because integers are plain old datatypes so we can always
// transmute them to arrays of bytes // transmute them to arrays of bytes
#[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn_transmute))] #[rustc_allow_const_fn_unstable(const_fn_transmute)]
#[cfg_attr(bootstrap, allow_internal_unstable(const_fn_transmute))]
#[inline] #[inline]
pub const fn to_ne_bytes(self) -> [u8; mem::size_of::<Self>()] { pub const fn to_ne_bytes(self) -> [u8; mem::size_of::<Self>()] {
// SAFETY: integers are plain old datatypes so we can always transmute them to // 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),
#[rustc_const_stable(feature = "const_int_conversion", since = "1.44.0")] #[rustc_const_stable(feature = "const_int_conversion", since = "1.44.0")]
// SAFETY: const sound because integers are plain old datatypes so we can always // SAFETY: const sound because integers are plain old datatypes so we can always
// transmute to them // transmute to them
#[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn_transmute))] #[rustc_allow_const_fn_unstable(const_fn_transmute)]
#[cfg_attr(bootstrap, allow_internal_unstable(const_fn_transmute))]
#[inline] #[inline]
pub const fn from_ne_bytes(bytes: [u8; mem::size_of::<Self>()]) -> Self { pub const fn from_ne_bytes(bytes: [u8; mem::size_of::<Self>()]) -> Self {
// SAFETY: integers are plain old datatypes so we can always transmute to them // SAFETY: integers are plain old datatypes so we can always transmute to them

View file

@ -52,7 +52,7 @@ pub fn panic(expr: &'static str) -> ! {
#[inline] #[inline]
#[track_caller] #[track_caller]
#[cfg_attr(not(bootstrap), lang = "panic_str")] // needed for const-evaluated panics #[lang = "panic_str"] // needed for const-evaluated panics
pub fn panic_str(expr: &str) -> ! { pub fn panic_str(expr: &str) -> ! {
panic_fmt(format_args!("{}", expr)); panic_fmt(format_args!("{}", expr));
} }

View file

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

View file

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

View file

@ -219,8 +219,7 @@ impl str {
#[rustc_const_stable(feature = "str_as_bytes", since = "1.32.0")] #[rustc_const_stable(feature = "str_as_bytes", since = "1.32.0")]
#[inline(always)] #[inline(always)]
#[allow(unused_attributes)] #[allow(unused_attributes)]
#[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn_transmute))] #[rustc_allow_const_fn_unstable(const_fn_transmute)]
#[cfg_attr(bootstrap, allow_internal_unstable(const_fn_transmute))]
pub const fn as_bytes(&self) -> &[u8] { pub const fn as_bytes(&self) -> &[u8] {
// SAFETY: const sound because we transmute two types with the same layout // SAFETY: const sound because we transmute two types with the same layout
unsafe { mem::transmute(self) } unsafe { mem::transmute(self) }

View file

@ -130,8 +130,7 @@ impl RawWakerVTable {
#[rustc_promotable] #[rustc_promotable]
#[stable(feature = "futures_api", since = "1.36.0")] #[stable(feature = "futures_api", since = "1.36.0")]
#[rustc_const_stable(feature = "futures_api", since = "1.36.0")] #[rustc_const_stable(feature = "futures_api", since = "1.36.0")]
#[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn_fn_ptr_basics))] #[rustc_allow_const_fn_unstable(const_fn_fn_ptr_basics)]
#[cfg_attr(bootstrap, allow_internal_unstable(const_fn_fn_ptr_basics))]
pub const fn new( pub const fn new(
clone: unsafe fn(*const ()) -> RawWaker, clone: unsafe fn(*const ()) -> RawWaker,
wake: unsafe fn(*const ()), wake: unsafe fn(*const ()),

View file

@ -401,8 +401,7 @@ fn run_client<A: for<'a, 's> DecodeMut<'a, 's, ()>, R: Encode<()>>(
} }
impl Client<fn(crate::TokenStream) -> crate::TokenStream> { impl Client<fn(crate::TokenStream) -> crate::TokenStream> {
#[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn))] #[rustc_allow_const_fn_unstable(const_fn)]
#[cfg_attr(bootstrap, allow_internal_unstable(const_fn))]
pub const fn expand1(f: fn(crate::TokenStream) -> crate::TokenStream) -> Self { pub const fn expand1(f: fn(crate::TokenStream) -> crate::TokenStream) -> Self {
extern "C" fn run( extern "C" fn run(
bridge: Bridge<'_>, bridge: Bridge<'_>,
@ -415,8 +414,7 @@ impl Client<fn(crate::TokenStream) -> crate::TokenStream> {
} }
impl Client<fn(crate::TokenStream, crate::TokenStream) -> crate::TokenStream> { impl Client<fn(crate::TokenStream, crate::TokenStream) -> crate::TokenStream> {
#[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn))] #[rustc_allow_const_fn_unstable(const_fn)]
#[cfg_attr(bootstrap, allow_internal_unstable(const_fn))]
pub const fn expand2( pub const fn expand2(
f: fn(crate::TokenStream, crate::TokenStream) -> crate::TokenStream, f: fn(crate::TokenStream, crate::TokenStream) -> crate::TokenStream,
) -> Self { ) -> Self {
@ -461,8 +459,7 @@ impl ProcMacro {
} }
} }
#[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn))] #[rustc_allow_const_fn_unstable(const_fn)]
#[cfg_attr(bootstrap, allow_internal_unstable(const_fn))]
pub const fn custom_derive( pub const fn custom_derive(
trait_name: &'static str, trait_name: &'static str,
attributes: &'static [&'static str], attributes: &'static [&'static str],
@ -471,8 +468,7 @@ impl ProcMacro {
ProcMacro::CustomDerive { trait_name, attributes, client: Client::expand1(expand) } ProcMacro::CustomDerive { trait_name, attributes, client: Client::expand1(expand) }
} }
#[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn))] #[rustc_allow_const_fn_unstable(const_fn)]
#[cfg_attr(bootstrap, allow_internal_unstable(const_fn))]
pub const fn attr( pub const fn attr(
name: &'static str, name: &'static str,
expand: fn(crate::TokenStream, crate::TokenStream) -> crate::TokenStream, expand: fn(crate::TokenStream, crate::TokenStream) -> crate::TokenStream,
@ -480,8 +476,7 @@ impl ProcMacro {
ProcMacro::Attr { name, client: Client::expand2(expand) } ProcMacro::Attr { name, client: Client::expand2(expand) }
} }
#[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn))] #[rustc_allow_const_fn_unstable(const_fn)]
#[cfg_attr(bootstrap, allow_internal_unstable(const_fn))]
pub const fn bang( pub const fn bang(
name: &'static str, name: &'static str,
expand: fn(crate::TokenStream) -> crate::TokenStream, expand: fn(crate::TokenStream) -> crate::TokenStream,

View file

@ -35,8 +35,7 @@ impl<'a, 'b, T: LambdaL> DerefMut for RefMutL<'a, 'b, T> {
pub struct ScopedCell<T: LambdaL>(Cell<<T as ApplyL<'static>>::Out>); pub struct ScopedCell<T: LambdaL>(Cell<<T as ApplyL<'static>>::Out>);
impl<T: LambdaL> ScopedCell<T> { impl<T: LambdaL> ScopedCell<T> {
#[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn))] #[rustc_allow_const_fn_unstable(const_fn)]
#[cfg_attr(bootstrap, allow_internal_unstable(const_fn))]
pub const fn new(value: <T as ApplyL<'static>>::Out) -> Self { pub const fn new(value: <T as ApplyL<'static>>::Out) -> Self {
ScopedCell(Cell::new(value)) ScopedCell(Cell::new(value))
} }

View file

@ -18,7 +18,7 @@
test(no_crate_inject, attr(deny(warnings))), test(no_crate_inject, attr(deny(warnings))),
test(attr(allow(dead_code, deprecated, unused_variables, unused_mut))) test(attr(allow(dead_code, deprecated, unused_variables, unused_mut)))
)] )]
#![cfg_attr(not(bootstrap), feature(rustc_allow_const_fn_unstable))] #![feature(rustc_allow_const_fn_unstable)]
#![feature(nll)] #![feature(nll)]
#![feature(staged_api)] #![feature(staged_api)]
#![feature(const_fn)] #![feature(const_fn)]

View file

@ -1266,7 +1266,7 @@ impl CStr {
/// behavior when `ptr` is used inside the `unsafe` block: /// behavior when `ptr` is used inside the `unsafe` block:
/// ///
/// ```no_run /// ```no_run
/// # #![allow(unused_must_use)] #![cfg_attr(not(bootstrap), allow(temporary_cstring_as_ptr))] /// # #![allow(unused_must_use)] #![allow(temporary_cstring_as_ptr)]
/// use std::ffi::CString; /// use std::ffi::CString;
/// ///
/// let ptr = CString::new("Hello").expect("CString::new failed").as_ptr(); /// let ptr = CString::new("Hello").expect("CString::new failed").as_ptr();

View file

@ -206,7 +206,7 @@
#![needs_panic_runtime] #![needs_panic_runtime]
// std may use features in a platform-specific way // std may use features in a platform-specific way
#![allow(unused_features)] #![allow(unused_features)]
#![cfg_attr(not(bootstrap), feature(rustc_allow_const_fn_unstable))] #![feature(rustc_allow_const_fn_unstable)]
#![cfg_attr(test, feature(internal_output_capture, print_internals, update_panic_count))] #![cfg_attr(test, feature(internal_output_capture, print_internals, update_panic_count))]
#![cfg_attr( #![cfg_attr(
all(target_vendor = "fortanix", target_env = "sgx"), all(target_vendor = "fortanix", target_env = "sgx"),
@ -324,7 +324,6 @@
#![feature(unsafe_block_in_unsafe_fn)] #![feature(unsafe_block_in_unsafe_fn)]
#![feature(unsafe_cell_get_mut)] #![feature(unsafe_cell_get_mut)]
#![feature(unsafe_cell_raw_get)] #![feature(unsafe_cell_raw_get)]
#![cfg_attr(bootstrap, feature(untagged_unions))]
#![feature(unwind_attributes)] #![feature(unwind_attributes)]
#![feature(vec_into_raw_parts)] #![feature(vec_into_raw_parts)]
#![feature(wake_trait)] #![feature(wake_trait)]

View file

@ -1043,8 +1043,7 @@ impl Ipv6Addr {
/// ``` /// ```
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "const_ipv6", since = "1.32.0")] #[rustc_const_stable(feature = "const_ipv6", since = "1.32.0")]
#[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn_transmute))] #[rustc_allow_const_fn_unstable(const_fn_transmute)]
#[cfg_attr(bootstrap, allow_internal_unstable(const_fn_transmute))]
pub const fn new(a: u16, b: u16, c: u16, d: u16, e: u16, f: u16, g: u16, h: u16) -> Ipv6Addr { pub const fn new(a: u16, b: u16, c: u16, d: u16, e: u16, f: u16, g: u16, h: u16) -> Ipv6Addr {
let addr16 = [ let addr16 = [
a.to_be(), a.to_be(),

View file

@ -12,7 +12,7 @@
# stable release's version number. `date` is the date where the release we're # stable release's version number. `date` is the date where the release we're
# bootstrapping off was released. # bootstrapping off was released.
date: 2020-10-16 date: 2020-11-18
rustc: beta rustc: beta
# We use a nightly rustfmt to format the source because it solves some # We use a nightly rustfmt to format the source because it solves some