1
Fork 0

Auto merge of #58793 - Mark-Simulacrum:master-next, r=alexcrichton

Bootstrap compiler update for 1.35 release

r? @alexcrichton
This commit is contained in:
bors 2019-03-03 05:51:44 +00:00
commit ba43811a07
13 changed files with 26 additions and 152 deletions

View file

@ -14,7 +14,7 @@ use crate::Build;
use crate::config::Config; use crate::config::Config;
// The version number // The version number
pub const CFG_RELEASE_NUM: &str = "1.34.0"; pub const CFG_RELEASE_NUM: &str = "1.35.0";
pub struct GitInfo { pub struct GitInfo {
inner: Option<Info>, inner: Option<Info>,

View file

@ -34,8 +34,7 @@
#[cfg(not(test))] #[cfg(not(test))]
#[macro_export] #[macro_export]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(stage0), allow_internal_unstable(box_syntax))] #[allow_internal_unstable(box_syntax)]
#[cfg_attr(stage0, allow_internal_unstable)]
macro_rules! vec { macro_rules! vec {
($elem:expr; $n:expr) => ( ($elem:expr; $n:expr) => (
$crate::vec::from_elem($elem, $n) $crate::vec::from_elem($elem, $n)

View file

@ -1282,13 +1282,11 @@ extern "rust-intrinsic" {
/// The stabilized versions of this intrinsic are available on the integer /// The stabilized versions of this intrinsic are available on the integer
/// primitives via the `saturating_add` method. For example, /// primitives via the `saturating_add` method. For example,
/// [`std::u32::saturating_add`](../../std/primitive.u32.html#method.saturating_add) /// [`std::u32::saturating_add`](../../std/primitive.u32.html#method.saturating_add)
#[cfg(not(stage0))]
pub fn saturating_add<T>(a: T, b: T) -> T; pub fn saturating_add<T>(a: T, b: T) -> T;
/// Computes `a - b`, while saturating at numeric bounds. /// Computes `a - b`, while saturating at numeric bounds.
/// The stabilized versions of this intrinsic are available on the integer /// The stabilized versions of this intrinsic are available on the integer
/// primitives via the `saturating_sub` method. For example, /// primitives via the `saturating_sub` method. For example,
/// [`std::u32::saturating_sub`](../../std/primitive.u32.html#method.saturating_sub) /// [`std::u32::saturating_sub`](../../std/primitive.u32.html#method.saturating_sub)
#[cfg(not(stage0))]
pub fn saturating_sub<T>(a: T, b: T) -> T; pub fn saturating_sub<T>(a: T, b: T) -> T;
/// Returns the value of the discriminant for the variant in 'v', /// Returns the value of the discriminant for the variant in 'v',

View file

@ -1,7 +1,6 @@
/// Entry point of thread panic. For details, see `std::macros`. /// Entry point of thread panic. For details, see `std::macros`.
#[macro_export] #[macro_export]
#[cfg_attr(not(stage0), allow_internal_unstable(core_panic, __rust_unstable_column))] #[allow_internal_unstable(core_panic, __rust_unstable_column)]
#[cfg_attr(stage0, allow_internal_unstable)]
#[stable(feature = "core", since = "1.6.0")] #[stable(feature = "core", since = "1.6.0")]
macro_rules! panic { macro_rules! panic {
() => ( () => (
@ -422,8 +421,7 @@ macro_rules! write {
/// ``` /// ```
#[macro_export] #[macro_export]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(stage0, allow_internal_unstable)] #[allow_internal_unstable(format_args_nl)]
#[cfg_attr(not(stage0), allow_internal_unstable(format_args_nl))]
macro_rules! writeln { macro_rules! writeln {
($dst:expr) => ( ($dst:expr) => (
write!($dst, "\n") write!($dst, "\n")

View file

@ -636,7 +636,7 @@ unsafe impl<T: ?Sized> Freeze for &mut T {}
/// [`Pin<P>`]: ../pin/struct.Pin.html /// [`Pin<P>`]: ../pin/struct.Pin.html
/// [`pin module`]: ../../std/pin/index.html /// [`pin module`]: ../../std/pin/index.html
#[stable(feature = "pin", since = "1.33.0")] #[stable(feature = "pin", since = "1.33.0")]
#[cfg_attr(not(stage0), lang = "unpin")] #[lang = "unpin"]
pub auto trait Unpin {} pub auto trait Unpin {}
/// A marker type which does not implement `Unpin`. /// A marker type which does not implement `Unpin`.

View file

@ -874,33 +874,6 @@ bounds instead of overflowing.
Basic usage: Basic usage:
```
", $Feature, "assert_eq!(100", stringify!($SelfT), ".saturating_add(1), 101);
assert_eq!(", stringify!($SelfT), "::max_value().saturating_add(100), ", stringify!($SelfT),
"::max_value());",
$EndFeature, "
```"),
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
#[cfg(stage0)]
pub fn saturating_add(self, rhs: Self) -> Self {
match self.checked_add(rhs) {
Some(x) => x,
None if rhs >= 0 => Self::max_value(),
None => Self::min_value(),
}
}
}
doc_comment! {
concat!("Saturating integer addition. Computes `self + rhs`, saturating at the numeric
bounds instead of overflowing.
# Examples
Basic usage:
``` ```
", $Feature, "assert_eq!(100", stringify!($SelfT), ".saturating_add(1), 101); ", $Feature, "assert_eq!(100", stringify!($SelfT), ".saturating_add(1), 101);
assert_eq!(", stringify!($SelfT), "::max_value().saturating_add(100), ", stringify!($SelfT), assert_eq!(", stringify!($SelfT), "::max_value().saturating_add(100), ", stringify!($SelfT),
@ -911,37 +884,11 @@ $EndFeature, "
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_saturating_int_methods")] #[rustc_const_unstable(feature = "const_saturating_int_methods")]
#[inline] #[inline]
#[cfg(not(stage0))]
pub const fn saturating_add(self, rhs: Self) -> Self { pub const fn saturating_add(self, rhs: Self) -> Self {
intrinsics::saturating_add(self, rhs) intrinsics::saturating_add(self, rhs)
} }
} }
doc_comment! {
concat!("Saturating integer subtraction. Computes `self - rhs`, saturating at the
numeric bounds instead of overflowing.
# Examples
Basic usage:
```
", $Feature, "assert_eq!(100", stringify!($SelfT), ".saturating_sub(127), -27);
assert_eq!(", stringify!($SelfT), "::min_value().saturating_sub(100), ", stringify!($SelfT),
"::min_value());",
$EndFeature, "
```"),
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
#[cfg(stage0)]
pub fn saturating_sub(self, rhs: Self) -> Self {
match self.checked_sub(rhs) {
Some(x) => x,
None if rhs >= 0 => Self::min_value(),
None => Self::max_value(),
}
}
}
doc_comment! { doc_comment! {
concat!("Saturating integer subtraction. Computes `self - rhs`, saturating at the concat!("Saturating integer subtraction. Computes `self - rhs`, saturating at the
@ -960,7 +907,6 @@ $EndFeature, "
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_saturating_int_methods")] #[rustc_const_unstable(feature = "const_saturating_int_methods")]
#[inline] #[inline]
#[cfg(not(stage0))]
pub const fn saturating_sub(self, rhs: Self) -> Self { pub const fn saturating_sub(self, rhs: Self) -> Self {
intrinsics::saturating_sub(self, rhs) intrinsics::saturating_sub(self, rhs)
} }
@ -2780,29 +2726,6 @@ the numeric bounds instead of overflowing.
Basic usage: Basic usage:
```
", $Feature, "assert_eq!(100", stringify!($SelfT), ".saturating_add(1), 101);
assert_eq!(200u8.saturating_add(127), 255);", $EndFeature, "
```"),
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
#[cfg(stage0)]
pub fn saturating_add(self, rhs: Self) -> Self {
match self.checked_add(rhs) {
Some(x) => x,
None => Self::max_value(),
}
}
}
doc_comment! {
concat!("Saturating integer addition. Computes `self + rhs`, saturating at
the numeric bounds instead of overflowing.
# Examples
Basic usage:
``` ```
", $Feature, "assert_eq!(100", stringify!($SelfT), ".saturating_add(1), 101); ", $Feature, "assert_eq!(100", stringify!($SelfT), ".saturating_add(1), 101);
assert_eq!(200u8.saturating_add(127), 255);", $EndFeature, " assert_eq!(200u8.saturating_add(127), 255);", $EndFeature, "
@ -2811,7 +2734,6 @@ assert_eq!(200u8.saturating_add(127), 255);", $EndFeature, "
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_saturating_int_methods")] #[rustc_const_unstable(feature = "const_saturating_int_methods")]
#[inline] #[inline]
#[cfg(not(stage0))]
pub const fn saturating_add(self, rhs: Self) -> Self { pub const fn saturating_add(self, rhs: Self) -> Self {
intrinsics::saturating_add(self, rhs) intrinsics::saturating_add(self, rhs)
} }
@ -2825,29 +2747,6 @@ at the numeric bounds instead of overflowing.
Basic usage: Basic usage:
```
", $Feature, "assert_eq!(100", stringify!($SelfT), ".saturating_sub(27), 73);
assert_eq!(13", stringify!($SelfT), ".saturating_sub(127), 0);", $EndFeature, "
```"),
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
#[cfg(stage0)]
pub fn saturating_sub(self, rhs: Self) -> Self {
match self.checked_sub(rhs) {
Some(x) => x,
None => Self::min_value(),
}
}
}
doc_comment! {
concat!("Saturating integer subtraction. Computes `self - rhs`, saturating
at the numeric bounds instead of overflowing.
# Examples
Basic usage:
``` ```
", $Feature, "assert_eq!(100", stringify!($SelfT), ".saturating_sub(27), 73); ", $Feature, "assert_eq!(100", stringify!($SelfT), ".saturating_sub(27), 73);
assert_eq!(13", stringify!($SelfT), ".saturating_sub(127), 0);", $EndFeature, " assert_eq!(13", stringify!($SelfT), ".saturating_sub(127), 0);", $EndFeature, "
@ -2855,7 +2754,6 @@ assert_eq!(13", stringify!($SelfT), ".saturating_sub(127), 0);", $EndFeature, "
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_saturating_int_methods")] #[rustc_const_unstable(feature = "const_saturating_int_methods")]
#[inline] #[inline]
#[cfg(not(stage0))]
pub const fn saturating_sub(self, rhs: Self) -> Self { pub const fn saturating_sub(self, rhs: Self) -> Self {
intrinsics::saturating_sub(self, rhs) intrinsics::saturating_sub(self, rhs)
} }

View file

@ -279,7 +279,7 @@ use ops::{Deref, DerefMut, Receiver, CoerceUnsized, DispatchFromDyn};
// implementations, are allowed because they all only use `&P`, so they cannot move // implementations, are allowed because they all only use `&P`, so they cannot move
// the value behind `pointer`. // the value behind `pointer`.
#[stable(feature = "pin", since = "1.33.0")] #[stable(feature = "pin", since = "1.33.0")]
#[cfg_attr(not(stage0), lang = "pin")] #[lang = "pin"]
#[fundamental] #[fundamental]
#[repr(transparent)] #[repr(transparent)]
#[derive(Copy, Clone, Hash, Eq, Ord)] #[derive(Copy, Clone, Hash, Eq, Ord)]

View file

@ -290,15 +290,11 @@ pub enum Ordering {
/// [`AtomicBool`]: struct.AtomicBool.html /// [`AtomicBool`]: struct.AtomicBool.html
#[cfg(target_has_atomic = "8")] #[cfg(target_has_atomic = "8")]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(stage0), rustc_deprecated( #[rustc_deprecated(
since = "1.34.0", since = "1.34.0",
reason = "the `new` function is now preferred", reason = "the `new` function is now preferred",
suggestion = "AtomicBool::new(false)", suggestion = "AtomicBool::new(false)",
))] )]
#[cfg_attr(stage0, rustc_deprecated(
since = "1.34.0",
reason = "the `new` function is now preferred",
))]
pub const ATOMIC_BOOL_INIT: AtomicBool = AtomicBool::new(false); pub const ATOMIC_BOOL_INIT: AtomicBool = AtomicBool::new(false);
#[cfg(target_has_atomic = "8")] #[cfg(target_has_atomic = "8")]
@ -1158,15 +1154,11 @@ macro_rules! atomic_int {
/// An atomic integer initialized to `0`. /// An atomic integer initialized to `0`.
#[$stable_init_const] #[$stable_init_const]
#[cfg_attr(stage0, rustc_deprecated( #[rustc_deprecated(
since = "1.34.0",
reason = "the `new` function is now preferred",
))]
#[cfg_attr(not(stage0), rustc_deprecated(
since = "1.34.0", since = "1.34.0",
reason = "the `new` function is now preferred", reason = "the `new` function is now preferred",
suggestion = $atomic_new, suggestion = $atomic_new,
))] )]
pub const $atomic_init: $atomic_type = $atomic_type::new(0); pub const $atomic_init: $atomic_type = $atomic_type::new(0);
#[$stable] #[$stable]

View file

@ -1,8 +1,7 @@
/// A simple static assertion macro. The first argument should be a unique /// A simple static assertion macro. The first argument should be a unique
/// ALL_CAPS identifier that describes the condition. /// ALL_CAPS identifier that describes the condition.
#[macro_export] #[macro_export]
#[cfg_attr(stage0, allow_internal_unstable)] #[allow_internal_unstable(type_ascription)]
#[cfg_attr(not(stage0), allow_internal_unstable(type_ascription))]
macro_rules! static_assert { macro_rules! static_assert {
($name:ident: $test:expr) => { ($name:ident: $test:expr) => {
// Use the bool to access an array such that if the bool is false, the access // Use the bool to access an array such that if the bool is false, the access

View file

@ -53,8 +53,7 @@
/// ``` /// ```
#[macro_export] #[macro_export]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(stage0, allow_internal_unstable)] #[allow_internal_unstable(__rust_unstable_column, libstd_sys_internals)]
#[cfg_attr(not(stage0), allow_internal_unstable(__rust_unstable_column, libstd_sys_internals))]
macro_rules! panic { macro_rules! panic {
() => ({ () => ({
panic!("explicit panic") panic!("explicit panic")
@ -112,8 +111,7 @@ macro_rules! panic {
/// ``` /// ```
#[macro_export] #[macro_export]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(stage0, allow_internal_unstable)] #[allow_internal_unstable(print_internals)]
#[cfg_attr(not(stage0), allow_internal_unstable(print_internals))]
macro_rules! print { macro_rules! print {
($($arg:tt)*) => ($crate::io::_print(format_args!($($arg)*))); ($($arg:tt)*) => ($crate::io::_print(format_args!($($arg)*)));
} }
@ -145,8 +143,7 @@ macro_rules! print {
/// ``` /// ```
#[macro_export] #[macro_export]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(stage0, allow_internal_unstable)] #[allow_internal_unstable(print_internals, format_args_nl)]
#[cfg_attr(not(stage0), allow_internal_unstable(print_internals, format_args_nl))]
macro_rules! println { macro_rules! println {
() => (print!("\n")); () => (print!("\n"));
($($arg:tt)*) => ({ ($($arg:tt)*) => ({
@ -177,8 +174,7 @@ macro_rules! println {
/// ``` /// ```
#[macro_export] #[macro_export]
#[stable(feature = "eprint", since = "1.19.0")] #[stable(feature = "eprint", since = "1.19.0")]
#[cfg_attr(stage0, allow_internal_unstable)] #[allow_internal_unstable(print_internals)]
#[cfg_attr(not(stage0), allow_internal_unstable(print_internals))]
macro_rules! eprint { macro_rules! eprint {
($($arg:tt)*) => ($crate::io::_eprint(format_args!($($arg)*))); ($($arg:tt)*) => ($crate::io::_eprint(format_args!($($arg)*)));
} }
@ -206,8 +202,7 @@ macro_rules! eprint {
/// ``` /// ```
#[macro_export] #[macro_export]
#[stable(feature = "eprint", since = "1.19.0")] #[stable(feature = "eprint", since = "1.19.0")]
#[cfg_attr(stage0, allow_internal_unstable)] #[allow_internal_unstable(print_internals, format_args_nl)]
#[cfg_attr(not(stage0), allow_internal_unstable(print_internals, format_args_nl))]
macro_rules! eprintln { macro_rules! eprintln {
() => (eprint!("\n")); () => (eprint!("\n"));
($($arg:tt)*) => ({ ($($arg:tt)*) => ({
@ -330,8 +325,7 @@ macro_rules! dbg {
/// A macro to await on an async call. /// A macro to await on an async call.
#[macro_export] #[macro_export]
#[unstable(feature = "await_macro", issue = "50547")] #[unstable(feature = "await_macro", issue = "50547")]
#[cfg_attr(stage0, allow_internal_unstable)] #[allow_internal_unstable(gen_future, generators)]
#[cfg_attr(not(stage0), allow_internal_unstable(gen_future, generators))]
#[allow_internal_unsafe] #[allow_internal_unsafe]
macro_rules! r#await { macro_rules! r#await {
($e:expr) => { { ($e:expr) => { {

View file

@ -126,8 +126,7 @@ impl<T: 'static> fmt::Debug for LocalKey<T> {
/// [`std::thread::LocalKey`]: ../std/thread/struct.LocalKey.html /// [`std::thread::LocalKey`]: ../std/thread/struct.LocalKey.html
#[macro_export] #[macro_export]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(stage0, allow_internal_unstable)] #[allow_internal_unstable(thread_local_internals)]
#[cfg_attr(not(stage0), allow_internal_unstable(thread_local_internals))]
macro_rules! thread_local { macro_rules! thread_local {
// empty (base case for the recursion) // empty (base case for the recursion)
() => {}; () => {};
@ -149,10 +148,7 @@ macro_rules! thread_local {
reason = "should not be necessary", reason = "should not be necessary",
issue = "0")] issue = "0")]
#[macro_export] #[macro_export]
#[cfg_attr(stage0, allow_internal_unstable)] #[allow_internal_unstable(thread_local_internals, cfg_target_thread_local, thread_local)]
#[cfg_attr(not(stage0), allow_internal_unstable(
thread_local_internals, cfg_target_thread_local, thread_local,
))]
#[allow_internal_unsafe] #[allow_internal_unsafe]
macro_rules! __thread_local_inner { macro_rules! __thread_local_inner {
(@key $(#[$attr:meta])* $vis:vis $name:ident, $t:ty, $init:expr) => { (@key $(#[$attr:meta])* $vis:vis $name:ident, $t:ty, $init:expr) => {

View file

@ -12,7 +12,7 @@
# source tarball for a stable release you'll likely see `1.x.0` for rustc and # source tarball for a stable release you'll likely see `1.x.0` for rustc and
# `0.x.0` for Cargo where they were released on `date`. # `0.x.0` for Cargo where they were released on `date`.
date: 2019-02-17 date: 2019-02-27
rustc: beta rustc: beta
cargo: beta cargo: beta

View file

@ -9,17 +9,17 @@ all: cpp-executable rust-executable
cpp-executable: cpp-executable:
$(RUSTC) -Clinker-plugin-lto=on -o $(TMPDIR)/librustlib-xlto.a -Copt-level=2 -Ccodegen-units=1 ./rustlib.rs $(RUSTC) -Clinker-plugin-lto=on -o $(TMPDIR)/librustlib-xlto.a -Copt-level=2 -Ccodegen-units=1 ./rustlib.rs
$(CLANG) -flto=thin -fuse-ld=lld -L $(TMPDIR) -lrustlib-xlto -o $(TMPDIR)/cmain ./cmain.c -O3 $(LD_LIB_PATH_ENVVAR)=$(REAL_LD_LIBRARY_PATH) $(CLANG) -flto=thin -fuse-ld=lld -L $(TMPDIR) -lrustlib-xlto -o $(TMPDIR)/cmain ./cmain.c -O3
# Make sure we don't find a call instruction to the function we expect to # Make sure we don't find a call instruction to the function we expect to
# always be inlined. # always be inlined.
llvm-objdump -d $(TMPDIR)/cmain | $(CGREP) -v -e "call.*rust_always_inlined" $(LD_LIB_PATH_ENVVAR)=$(REAL_LD_LIBRARY_PATH) llvm-objdump -d $(TMPDIR)/cmain | $(CGREP) -v -e "call.*rust_always_inlined"
# As a sanity check, make sure we do find a call instruction to a # As a sanity check, make sure we do find a call instruction to a
# non-inlined function # non-inlined function
llvm-objdump -d $(TMPDIR)/cmain | $(CGREP) -e "call.*rust_never_inlined" $(LD_LIB_PATH_ENVVAR)=$(REAL_LD_LIBRARY_PATH) llvm-objdump -d $(TMPDIR)/cmain | $(CGREP) -e "call.*rust_never_inlined"
rust-executable: rust-executable:
$(CLANG) ./clib.c -flto=thin -c -o $(TMPDIR)/clib.o -O2 $(LD_LIB_PATH_ENVVAR)=$(REAL_LD_LIBRARY_PATH) $(CLANG) ./clib.c -flto=thin -c -o $(TMPDIR)/clib.o -O2
(cd $(TMPDIR); $(AR) crus ./libxyz.a ./clib.o) (cd $(TMPDIR); $(AR) crus ./libxyz.a ./clib.o)
$(RUSTC) -Clinker-plugin-lto=on -L$(TMPDIR) -Copt-level=2 -Clinker=$(CLANG) -Clink-arg=-fuse-ld=lld ./main.rs -o $(TMPDIR)/rsmain $(RUSTC) -Clinker-plugin-lto=on -L$(TMPDIR) -Copt-level=2 -Clinker=$(CLANG) -Clink-arg=-fuse-ld=lld ./main.rs -o $(TMPDIR)/rsmain
llvm-objdump -d $(TMPDIR)/rsmain | $(CGREP) -e "call.*c_never_inlined" $(LD_LIB_PATH_ENVVAR)=$(REAL_LD_LIBRARY_PATH) llvm-objdump -d $(TMPDIR)/rsmain | $(CGREP) -e "call.*c_never_inlined"
llvm-objdump -d $(TMPDIR)/rsmain | $(CGREP) -v -e "call.*c_always_inlined" $(LD_LIB_PATH_ENVVAR)=$(REAL_LD_LIBRARY_PATH) llvm-objdump -d $(TMPDIR)/rsmain | $(CGREP) -v -e "call.*c_always_inlined"