From 71393422495b8d3c7a6e4ded3e64adaec45dca6d Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Wed, 3 Jun 2020 15:15:53 -0400 Subject: Bump to 1.46 --- src/libcore/intrinsics.rs | 5 ----- src/libcore/marker.rs | 14 +------------- src/libcore/ops/try.rs | 2 +- src/libcore/panicking.rs | 21 +++------------------ 4 files changed, 5 insertions(+), 37 deletions(-) (limited to 'src/libcore') diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs index 2d97fecf8a7..85076a573b5 100644 --- a/src/libcore/intrinsics.rs +++ b/src/libcore/intrinsics.rs @@ -54,7 +54,6 @@ )] #![allow(missing_docs)] -#[cfg(not(bootstrap))] use crate::marker::DiscriminantKind; use crate::mem; @@ -1916,11 +1915,7 @@ extern "rust-intrinsic" { /// The stabilized version of this intrinsic is /// [`std::mem::discriminant`](../../std/mem/fn.discriminant.html) #[rustc_const_unstable(feature = "const_discriminant", issue = "69821")] - #[cfg(not(bootstrap))] pub fn discriminant_value(v: &T) -> ::Discriminant; - #[rustc_const_unstable(feature = "const_discriminant", issue = "69821")] - #[cfg(bootstrap)] - pub fn discriminant_value(v: &T) -> u64; /// Rust's "try catch" construct which invokes the function pointer `try_fn` /// with the data pointer `data`. diff --git a/src/libcore/marker.rs b/src/libcore/marker.rs index c0c0f66aff9..6040dd31847 100644 --- a/src/libcore/marker.rs +++ b/src/libcore/marker.rs @@ -692,25 +692,13 @@ mod impls { issue = "none", reason = "this trait is unlikely to ever be stabilized, use `mem::discriminant` instead" )] -#[cfg_attr(not(bootstrap), lang = "discriminant_kind")] +#[lang = "discriminant_kind"] pub trait DiscriminantKind { /// The type of the dicriminant, which must satisfy the trait /// bounds required by `mem::Discriminant`. type Discriminant: Clone + Copy + Debug + Eq + PartialEq + Hash + Send + Sync + Unpin; } -// Manually implement `DiscriminantKind` for all types during bootstrap -// to reduce the required amount of conditional compilation. -#[unstable( - feature = "discriminant_kind", - issue = "none", - reason = "this trait is unlikely to ever be stabilized, use `mem::discriminant` instead" -)] -#[cfg(bootstrap)] -impl DiscriminantKind for T { - type Discriminant = u64; -} - /// Compiler-internal trait used to determine whether a type contains /// any `UnsafeCell` internally, but not through an indirection. /// This affects, for example, whether a `static` of that type is diff --git a/src/libcore/ops/try.rs b/src/libcore/ops/try.rs index e15ea11569f..9bc35ae1f5c 100644 --- a/src/libcore/ops/try.rs +++ b/src/libcore/ops/try.rs @@ -25,7 +25,7 @@ ) )] #[doc(alias = "?")] -#[cfg_attr(not(bootstrap), lang = "try")] +#[lang = "try"] pub trait Try { /// The type of this value when viewed as successful. #[unstable(feature = "try_trait", issue = "42327")] diff --git a/src/libcore/panicking.rs b/src/libcore/panicking.rs index 16739b4a1af..3ed5e65e11c 100644 --- a/src/libcore/panicking.rs +++ b/src/libcore/panicking.rs @@ -39,12 +39,7 @@ use crate::panic::{Location, PanicInfo}; #[lang = "panic"] // needed by codegen for panic on overflow and other `Assert` MIR terminators pub fn panic(expr: &str) -> ! { if cfg!(feature = "panic_immediate_abort") { - // remove `unsafe` (and safety comment) on bootstrap bump - #[cfg_attr(not(bootstrap), allow(unused_unsafe))] - // SAFETY: the `abort` intrinsic has no requirements to be called. - unsafe { - super::intrinsics::abort() - } + super::intrinsics::abort() } // Use Arguments::new_v1 instead of format_args!("{}", expr) to potentially @@ -62,12 +57,7 @@ pub fn panic(expr: &str) -> ! { #[lang = "panic_bounds_check"] // needed by codegen for panic on OOB array/slice access fn panic_bounds_check(index: usize, len: usize) -> ! { if cfg!(feature = "panic_immediate_abort") { - // remove `unsafe` (and safety comment) on bootstrap bump - #[cfg_attr(not(bootstrap), allow(unused_unsafe))] - // SAFETY: the `abort` intrinsic has no requirements to be called. - unsafe { - super::intrinsics::abort() - } + super::intrinsics::abort() } panic!("index out of bounds: the len is {} but the index is {}", len, index) @@ -80,12 +70,7 @@ fn panic_bounds_check(index: usize, len: usize) -> ! { #[track_caller] pub fn panic_fmt(fmt: fmt::Arguments<'_>) -> ! { if cfg!(feature = "panic_immediate_abort") { - // remove `unsafe` (and safety comment) on bootstrap bump - #[cfg_attr(not(bootstrap), allow(unused_unsafe))] - // SAFETY: the `abort` intrinsic has no requirements to be called. - unsafe { - super::intrinsics::abort() - } + super::intrinsics::abort() } // NOTE This function never crosses the FFI boundary; it's a Rust-to-Rust call -- cgit 1.4.1-3-g733a5