Skip to content

Commit

Permalink
Auto merge of #80511 - Mark-Simulacrum:bump-stage0, r=pietroalbini
Browse files Browse the repository at this point in the history
Bump bootstrap compiler to 1.50 beta

r? `@pietroalbini`
  • Loading branch information
bors committed Dec 30, 2020
2 parents 507bff9 + fe03118 commit e226704
Show file tree
Hide file tree
Showing 15 changed files with 19 additions and 92 deletions.
3 changes: 1 addition & 2 deletions compiler/rustc_data_structures/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
#![feature(fn_traits)]
#![feature(int_bits_const)]
#![feature(min_specialization)]
#![cfg_attr(bootstrap, feature(optin_builtin_traits))]
#![cfg_attr(not(bootstrap), feature(auto_traits))]
#![feature(auto_traits)]
#![feature(nll)]
#![feature(allow_internal_unstable)]
#![feature(hash_raw_entry)]
Expand Down
3 changes: 1 addition & 2 deletions library/alloc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@
#![feature(never_type)]
#![feature(nll)]
#![feature(nonnull_slice_from_raw_parts)]
#![cfg_attr(bootstrap, feature(optin_builtin_traits))]
#![cfg_attr(not(bootstrap), feature(auto_traits))]
#![feature(auto_traits)]
#![feature(or_patterns)]
#![feature(pattern)]
#![feature(ptr_internals)]
Expand Down
1 change: 0 additions & 1 deletion library/core/src/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1736,7 +1736,6 @@ extern "rust-intrinsic" {

/// Allocate at compile time. Should not be called at runtime.
#[rustc_const_unstable(feature = "const_heap", issue = "79597")]
#[cfg(not(bootstrap))]
pub fn const_allocate(size: usize, align: usize) -> *mut u8;
}

Expand Down
5 changes: 2 additions & 3 deletions library/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
#![feature(arbitrary_self_types)]
#![feature(asm)]
#![feature(cfg_target_has_atomic)]
#![cfg_attr(not(bootstrap), feature(const_heap))]
#![feature(const_heap)]
#![feature(const_alloc_layout)]
#![feature(const_assert_type)]
#![feature(const_discriminant)]
Expand Down Expand Up @@ -124,8 +124,7 @@
#![feature(nll)]
#![feature(exhaustive_patterns)]
#![feature(no_core)]
#![cfg_attr(bootstrap, feature(optin_builtin_traits))]
#![cfg_attr(not(bootstrap), feature(auto_traits))]
#![feature(auto_traits)]
#![feature(or_patterns)]
#![feature(prelude_import)]
#![feature(repr_simd, platform_intrinsics)]
Expand Down
6 changes: 3 additions & 3 deletions library/core/src/macros/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#[macro_export]
#[allow_internal_unstable(core_panic, const_caller_location)]
#[stable(feature = "core", since = "1.6.0")]
#[cfg_attr(not(bootstrap), rustc_diagnostic_item = "core_panic_macro")]
#[rustc_diagnostic_item = "core_panic_macro"]
macro_rules! panic {
() => (
$crate::panic!("explicit panic")
Expand Down Expand Up @@ -163,7 +163,7 @@ macro_rules! assert_ne {
/// ```
#[macro_export]
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(bootstrap), rustc_diagnostic_item = "debug_assert_macro")]
#[rustc_diagnostic_item = "debug_assert_macro"]
macro_rules! debug_assert {
($($arg:tt)*) => (if $crate::cfg!(debug_assertions) { $crate::assert!($($arg)*); })
}
Expand Down Expand Up @@ -1217,7 +1217,7 @@ pub(crate) mod builtin {
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_builtin_macro]
#[macro_export]
#[cfg_attr(not(bootstrap), rustc_diagnostic_item = "assert_macro")]
#[rustc_diagnostic_item = "assert_macro"]
#[allow_internal_unstable(core_panic)]
macro_rules! assert {
($cond:expr $(,)?) => {{ /* compiler built-in */ }};
Expand Down
66 changes: 4 additions & 62 deletions library/core/src/sync/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -991,16 +991,8 @@ impl<T> AtomicPtr<T> {
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn load(&self, order: Ordering) -> *mut T {
#[cfg(not(bootstrap))]
// SAFETY: data races are prevented by atomic intrinsics.
unsafe {
atomic_load(self.p.get(), order)
}
#[cfg(bootstrap)]
// SAFETY: data races are prevented by atomic intrinsics.
unsafe {
atomic_load(self.p.get() as *mut usize, order) as *mut T
}
unsafe { atomic_load(self.p.get(), order) }
}

/// Stores a value into the pointer.
Expand All @@ -1027,16 +1019,10 @@ impl<T> AtomicPtr<T> {
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn store(&self, ptr: *mut T, order: Ordering) {
#[cfg(not(bootstrap))]
// SAFETY: data races are prevented by atomic intrinsics.
unsafe {
atomic_store(self.p.get(), ptr, order);
}
#[cfg(bootstrap)]
// SAFETY: data races are prevented by atomic intrinsics.
unsafe {
atomic_store(self.p.get() as *mut usize, ptr as usize, order);
}
}

/// Stores a value into the pointer, returning the previous value.
Expand Down Expand Up @@ -1065,16 +1051,8 @@ impl<T> AtomicPtr<T> {
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg(target_has_atomic = "ptr")]
pub fn swap(&self, ptr: *mut T, order: Ordering) -> *mut T {
#[cfg(bootstrap)]
// SAFETY: data races are prevented by atomic intrinsics.
unsafe {
atomic_swap(self.p.get() as *mut usize, ptr as usize, order) as *mut T
}
#[cfg(not(bootstrap))]
// SAFETY: data races are prevented by atomic intrinsics.
unsafe {
atomic_swap(self.p.get(), ptr, order)
}
unsafe { atomic_swap(self.p.get(), ptr, order) }
}

/// Stores a value into the pointer if the current value is the same as the `current` value.
Expand Down Expand Up @@ -1174,26 +1152,8 @@ impl<T> AtomicPtr<T> {
success: Ordering,
failure: Ordering,
) -> Result<*mut T, *mut T> {
#[cfg(bootstrap)]
// SAFETY: data races are prevented by atomic intrinsics.
unsafe {
let res = atomic_compare_exchange(
self.p.get() as *mut usize,
current as usize,
new as usize,
success,
failure,
);
match res {
Ok(x) => Ok(x as *mut T),
Err(x) => Err(x as *mut T),
}
}
#[cfg(not(bootstrap))]
// SAFETY: data races are prevented by atomic intrinsics.
unsafe {
atomic_compare_exchange(self.p.get(), current, new, success, failure)
}
unsafe { atomic_compare_exchange(self.p.get(), current, new, success, failure) }
}

/// Stores a value into the pointer if the current value is the same as the `current` value.
Expand Down Expand Up @@ -1241,29 +1201,11 @@ impl<T> AtomicPtr<T> {
success: Ordering,
failure: Ordering,
) -> Result<*mut T, *mut T> {
#[cfg(bootstrap)]
// SAFETY: data races are prevented by atomic intrinsics.
unsafe {
let res = atomic_compare_exchange_weak(
self.p.get() as *mut usize,
current as usize,
new as usize,
success,
failure,
);
match res {
Ok(x) => Ok(x as *mut T),
Err(x) => Err(x as *mut T),
}
}
#[cfg(not(bootstrap))]
// SAFETY: This intrinsic is unsafe because it operates on a raw pointer
// but we know for sure that the pointer is valid (we just got it from
// an `UnsafeCell` that we have by reference) and the atomic operation
// itself allows us to safely mutate the `UnsafeCell` contents.
unsafe {
atomic_compare_exchange_weak(self.p.get(), current, new, success, failure)
}
unsafe { atomic_compare_exchange_weak(self.p.get(), current, new, success, failure) }
}

/// Fetches the value, and applies a function to it that returns an optional
Expand Down
1 change: 0 additions & 1 deletion library/core/tests/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ fn test_discriminant_send_sync() {
}

#[test]
#[cfg(not(bootstrap))]
fn assume_init_good() {
const TRUE: bool = unsafe { MaybeUninit::<bool>::new(true).assume_init() };

Expand Down
3 changes: 1 addition & 2 deletions library/proc_macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
#![feature(extern_types)]
#![feature(in_band_lifetimes)]
#![feature(negative_impls)]
#![cfg_attr(bootstrap, feature(optin_builtin_traits))]
#![cfg_attr(not(bootstrap), feature(auto_traits))]
#![feature(auto_traits)]
#![feature(restricted_std)]
#![feature(rustc_attrs)]
#![feature(min_specialization)]
Expand Down
3 changes: 1 addition & 2 deletions library/rtstartup/rsbegin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@

#![feature(no_core)]
#![feature(lang_items)]
#![cfg_attr(bootstrap, feature(optin_builtin_traits))]
#![cfg_attr(not(bootstrap), feature(auto_traits))]
#![feature(auto_traits)]
#![crate_type = "rlib"]
#![no_core]
#![allow(non_camel_case_types)]
Expand Down
3 changes: 1 addition & 2 deletions library/rtstartup/rsend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

#![feature(no_core)]
#![feature(lang_items)]
#![cfg_attr(bootstrap, feature(optin_builtin_traits))]
#![cfg_attr(not(bootstrap), feature(auto_traits))]
#![feature(auto_traits)]
#![crate_type = "rlib"]
#![no_core]

Expand Down
3 changes: 1 addition & 2 deletions library/std/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,7 @@
#![feature(nll)]
#![feature(nonnull_slice_from_raw_parts)]
#![feature(once_cell)]
#![cfg_attr(bootstrap, feature(optin_builtin_traits))]
#![cfg_attr(not(bootstrap), feature(auto_traits))]
#![feature(auto_traits)]
#![feature(or_patterns)]
#![feature(panic_info_message)]
#![feature(panic_internals)]
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#[macro_export]
#[stable(feature = "rust1", since = "1.0.0")]
#[allow_internal_unstable(libstd_sys_internals)]
#[cfg_attr(not(any(bootstrap, test)), rustc_diagnostic_item = "std_panic_macro")]
#[cfg_attr(not(test), rustc_diagnostic_item = "std_panic_macro")]
macro_rules! panic {
() => ({ $crate::panic!("explicit panic") });
($msg:expr $(,)?) => ({ $crate::rt::begin_panic($msg) });
Expand Down
5 changes: 1 addition & 4 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -736,10 +736,7 @@ impl<'a> Builder<'a> {
if self.config.deny_warnings {
cmd.arg("-Dwarnings");
}
// cfg(not(bootstrap)), can be removed on the next beta bump
if compiler.stage != 0 {
cmd.arg("-Znormalize-docs");
}
cmd.arg("-Znormalize-docs");

// Remove make-related flags that can cause jobserver problems.
cmd.env_remove("MAKEFLAGS");
Expand Down
5 changes: 1 addition & 4 deletions src/bootstrap/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -530,10 +530,7 @@ impl Step for Rustc {
cargo.rustdocflag("--document-private-items");
cargo.rustdocflag("--enable-index-page");
cargo.rustdocflag("-Zunstable-options");
// cfg(not(bootstrap)), can be removed on the next beta bump
if stage != 0 {
cargo.rustdocflag("-Znormalize-docs");
}
cargo.rustdocflag("-Znormalize-docs");
compile::rustc_cargo(builder, &mut cargo, target);

// Only include compiler crates, no dependencies of those, such as `libc`.
Expand Down
2 changes: 1 addition & 1 deletion src/stage0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# stable release's version number. `date` is the date where the release we're
# bootstrapping off was released.

date: 2020-11-18
date: 2020-12-30
rustc: beta

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

0 comments on commit e226704

Please sign in to comment.