about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorMark Rousskov <mark.simulacrum@gmail.com>2019-07-04 10:05:50 -0400
committerMark Rousskov <mark.simulacrum@gmail.com>2019-07-04 11:26:57 -0400
commit8a7dded1a249a21540583333204c378bf960a700 (patch)
treea3f2218f1d0ec0a122a3b947ed837268aa688981 /src/libcore
parentb43eb4235ac43c822d903ad26ed806f34cc1a14a (diff)
downloadrust-8a7dded1a249a21540583333204c378bf960a700.tar.gz
rust-8a7dded1a249a21540583333204c378bf960a700.zip
Switch master to 1.38
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/ffi.rs6
-rw-r--r--src/libcore/future/future.rs2
-rw-r--r--src/libcore/intrinsics.rs57
-rw-r--r--src/libcore/lib.rs2
-rw-r--r--src/libcore/mem/maybe_uninit.rs2
-rw-r--r--src/libcore/num/mod.rs2
-rw-r--r--src/libcore/ptr/non_null.rs2
7 files changed, 5 insertions, 68 deletions
diff --git a/src/libcore/ffi.rs b/src/libcore/ffi.rs
index 49090fb8e43..4f87cc506ef 100644
--- a/src/libcore/ffi.rs
+++ b/src/libcore/ffi.rs
@@ -302,7 +302,6 @@ impl<T> sealed_trait::VaArgSafe for *const T {}
            reason = "the `c_variadic` feature has not been properly tested on \
                      all supported platforms",
            issue = "44930")]
-#[cfg(not(bootstrap))]
 impl<'f> VaListImpl<'f> {
     /// Advance to the next arg.
     #[inline]
@@ -324,7 +323,6 @@ impl<'f> VaListImpl<'f> {
            reason = "the `c_variadic` feature has not been properly tested on \
                      all supported platforms",
            issue = "44930")]
-#[cfg(not(bootstrap))]
 impl<'f> Clone for VaListImpl<'f> {
     #[inline]
     fn clone(&self) -> Self {
@@ -340,7 +338,6 @@ impl<'f> Clone for VaListImpl<'f> {
            reason = "the `c_variadic` feature has not been properly tested on \
                      all supported platforms",
            issue = "44930")]
-#[cfg(not(bootstrap))]
 impl<'f> Drop for VaListImpl<'f> {
     fn drop(&mut self) {
         // FIXME: this should call `va_end`, but there's no clean way to
@@ -359,15 +356,12 @@ impl<'f> Drop for VaListImpl<'f> {
 extern "rust-intrinsic" {
     /// Destroy the arglist `ap` after initialization with `va_start` or
     /// `va_copy`.
-    #[cfg(not(bootstrap))]
     fn va_end(ap: &mut VaListImpl<'_>);
 
     /// Copies the current location of arglist `src` to the arglist `dst`.
-    #[cfg(not(bootstrap))]
     fn va_copy<'f>(dest: *mut VaListImpl<'f>, src: &VaListImpl<'f>);
 
     /// Loads an argument of type `T` from the `va_list` `ap` and increment the
     /// argument `ap` points to.
-    #[cfg(not(bootstrap))]
     fn va_arg<T: sealed_trait::VaArgSafe>(ap: &mut VaListImpl<'_>) -> T;
 }
diff --git a/src/libcore/future/future.rs b/src/libcore/future/future.rs
index acca8d7ba15..8bd1601a362 100644
--- a/src/libcore/future/future.rs
+++ b/src/libcore/future/future.rs
@@ -25,7 +25,7 @@ use crate::task::{Context, Poll};
 #[doc(spotlight)]
 #[must_use = "futures do nothing unless you `.await` or poll them"]
 #[stable(feature = "futures_api", since = "1.36.0")]
-#[cfg_attr(not(bootstrap), lang = "future_trait")]
+#[lang = "future_trait"]
 pub trait Future {
     /// The type of value produced on completion.
     #[stable(feature = "futures_api", since = "1.36.0")]
diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs
index b30eff8baa9..8e53022c287 100644
--- a/src/libcore/intrinsics.rs
+++ b/src/libcore/intrinsics.rs
@@ -1052,16 +1052,12 @@ extern "rust-intrinsic" {
     pub fn fabsf64(x: f64) -> f64;
 
     /// Returns the minimum of two `f32` values.
-    #[cfg(not(bootstrap))]
     pub fn minnumf32(x: f32, y: f32) -> f32;
     /// Returns the minimum of two `f64` values.
-    #[cfg(not(bootstrap))]
     pub fn minnumf64(x: f64, y: f64) -> f64;
     /// Returns the maximum of two `f32` values.
-    #[cfg(not(bootstrap))]
     pub fn maxnumf32(x: f32, y: f32) -> f32;
     /// Returns the maximum of two `f64` values.
-    #[cfg(not(bootstrap))]
     pub fn maxnumf64(x: f64, y: f64) -> f64;
 
     /// Copies the sign from `y` to `x` for `f32` values.
@@ -1255,17 +1251,14 @@ extern "rust-intrinsic" {
 
     /// Returns the result of an unchecked addition, resulting in
     /// undefined behavior when `x + y > T::max_value()` or `x + y < T::min_value()`.
-    #[cfg(not(bootstrap))]
     pub fn unchecked_add<T>(x: T, y: T) -> T;
 
     /// Returns the result of an unchecked substraction, resulting in
     /// undefined behavior when `x - y > T::max_value()` or `x - y < T::min_value()`.
-    #[cfg(not(bootstrap))]
     pub fn unchecked_sub<T>(x: T, y: T) -> T;
 
     /// Returns the result of an unchecked multiplication, resulting in
     /// undefined behavior when `x * y > T::max_value()` or `x * y < T::min_value()`.
-    #[cfg(not(bootstrap))]
     pub fn unchecked_mul<T>(x: T, y: T) -> T;
 
     /// Performs rotate left.
@@ -1563,53 +1556,3 @@ pub unsafe fn write_bytes<T>(dst: *mut T, val: u8, count: usize) {
     }
     write_bytes(dst, val, count)
 }
-
-// Simple bootstrap implementations of minnum/maxnum for stage0 compilation.
-
-/// Returns the minimum of two `f32` values.
-#[cfg(bootstrap)]
-pub fn minnumf32(x: f32, y: f32) -> f32 {
-    // IEEE754 says: minNum(x, y) is the canonicalized number x if x < y, y if y < x, the
-    // canonicalized number if one operand is a number and the other a quiet NaN. Otherwise it
-    // is either x or y, canonicalized (this means results might differ among implementations).
-    // When either x or y is a signaling NaN, then the result is according to 6.2.
-    //
-    // Since we do not support sNaN in Rust yet, we do not need to handle them.
-    // FIXME(nagisa): due to https://bugs.llvm.org/show_bug.cgi?id=33303 we canonicalize by
-    // multiplying by 1.0. Should switch to the `canonicalize` when it works.
-    (if x < y || y != y { x } else { y }) * 1.0
-}
-
-/// Returns the minimum of two `f64` values.
-#[cfg(bootstrap)]
-pub fn minnumf64(x: f64, y: f64) -> f64 {
-    // Identical to the `f32` case.
-    (if x < y || y != y { x } else { y }) * 1.0
-}
-
-/// Returns the maximum of two `f32` values.
-#[cfg(bootstrap)]
-pub fn maxnumf32(x: f32, y: f32) -> f32 {
-    // IEEE754 says: maxNum(x, y) is the canonicalized number y if x < y, x if y < x, the
-    // canonicalized number if one operand is a number and the other a quiet NaN. Otherwise it
-    // is either x or y, canonicalized (this means results might differ among implementations).
-    // When either x or y is a signaling NaN, then the result is according to 6.2.
-    //
-    // Since we do not support sNaN in Rust yet, we do not need to handle them.
-    // FIXME(nagisa): due to https://bugs.llvm.org/show_bug.cgi?id=33303 we canonicalize by
-    // multiplying by 1.0. Should switch to the `canonicalize` when it works.
-    (if x < y || x != x { y } else { x }) * 1.0
-}
-
-/// Returns the maximum of two `f64` values.
-#[cfg(bootstrap)]
-pub fn maxnumf64(x: f64, y: f64) -> f64 {
-    // Identical to the `f32` case.
-    (if x < y || x != x { y } else { x }) * 1.0
-}
-
-/// For bootstrapping, implement unchecked_sub as just wrapping_sub.
-#[cfg(bootstrap)]
-pub unsafe fn unchecked_sub<T>(x: T, y: T) -> T {
-    sub_with_overflow(x, y).0
-}
diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs
index d2d08a075b9..398b929b206 100644
--- a/src/libcore/lib.rs
+++ b/src/libcore/lib.rs
@@ -99,7 +99,7 @@
 #![feature(staged_api)]
 #![feature(std_internals)]
 #![feature(stmt_expr_attributes)]
-#![cfg_attr(not(bootstrap), feature(transparent_unions))]
+#![feature(transparent_unions)]
 #![feature(unboxed_closures)]
 #![feature(unsized_locals)]
 #![feature(untagged_unions)]
diff --git a/src/libcore/mem/maybe_uninit.rs b/src/libcore/mem/maybe_uninit.rs
index 28e1e22ba7f..407691662d1 100644
--- a/src/libcore/mem/maybe_uninit.rs
+++ b/src/libcore/mem/maybe_uninit.rs
@@ -207,7 +207,7 @@ use crate::mem::ManuallyDrop;
 #[allow(missing_debug_implementations)]
 #[stable(feature = "maybe_uninit", since = "1.36.0")]
 #[derive(Copy)]
-#[cfg_attr(not(bootstrap), repr(transparent))]
+#[repr(transparent)]
 pub union MaybeUninit<T> {
     uninit: (),
     value: ManuallyDrop<T>,
diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs
index d70f5567011..72552c5a0b0 100644
--- a/src/libcore/num/mod.rs
+++ b/src/libcore/num/mod.rs
@@ -50,7 +50,7 @@ assert_eq!(size_of::<Option<core::num::", stringify!($Ty), ">>(), size_of::<", s
                 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
                 #[repr(transparent)]
                 #[rustc_layout_scalar_valid_range_start(1)]
-                #[cfg_attr(not(bootstrap), rustc_nonnull_optimization_guaranteed)]
+                #[rustc_nonnull_optimization_guaranteed]
                 pub struct $Ty($Int);
             }
 
diff --git a/src/libcore/ptr/non_null.rs b/src/libcore/ptr/non_null.rs
index 46dde7c1da5..ad3d1ce396a 100644
--- a/src/libcore/ptr/non_null.rs
+++ b/src/libcore/ptr/non_null.rs
@@ -38,7 +38,7 @@ use crate::cmp::Ordering;
 #[stable(feature = "nonnull", since = "1.25.0")]
 #[repr(transparent)]
 #[rustc_layout_scalar_valid_range_start(1)]
-#[cfg_attr(not(bootstrap), rustc_nonnull_optimization_guaranteed)]
+#[rustc_nonnull_optimization_guaranteed]
 pub struct NonNull<T: ?Sized> {
     pointer: *const T,
 }