mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Update bootstrap compiler
This commit updates the bootstrap compiler and clears out a number of #[cfg(stage0)] annotations and related business
This commit is contained in:
parent
97b01abf3d
commit
2972687d10
@ -123,14 +123,6 @@ macro_rules! array_impls {
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[cfg(stage0)]
|
||||
impl<T:Copy> Clone for [T; $N] {
|
||||
fn clone(&self) -> [T; $N] {
|
||||
*self
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<T: Hash> Hash for [T; $N] {
|
||||
fn hash<H: hash::Hasher>(&self, state: &mut H) {
|
||||
|
@ -88,7 +88,7 @@
|
||||
/// }
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[cfg_attr(not(stage0), lang = "clone")]
|
||||
#[lang = "clone"]
|
||||
pub trait Clone : Sized {
|
||||
/// Returns a copy of the value.
|
||||
///
|
||||
@ -130,45 +130,3 @@ pub struct AssertParamIsClone<T: Clone + ?Sized> { _field: ::marker::PhantomData
|
||||
reason = "deriving hack, should not be public",
|
||||
issue = "0")]
|
||||
pub struct AssertParamIsCopy<T: Copy + ?Sized> { _field: ::marker::PhantomData<T> }
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[cfg(stage0)]
|
||||
impl<'a, T: ?Sized> Clone for &'a T {
|
||||
/// Returns a shallow copy of the reference.
|
||||
#[inline]
|
||||
fn clone(&self) -> &'a T { *self }
|
||||
}
|
||||
|
||||
macro_rules! clone_impl {
|
||||
($t:ty) => {
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[cfg(stage0)]
|
||||
impl Clone for $t {
|
||||
/// Returns a deep copy of the value.
|
||||
#[inline]
|
||||
fn clone(&self) -> $t { *self }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
clone_impl! { isize }
|
||||
clone_impl! { i8 }
|
||||
clone_impl! { i16 }
|
||||
clone_impl! { i32 }
|
||||
clone_impl! { i64 }
|
||||
clone_impl! { i128 }
|
||||
|
||||
clone_impl! { usize }
|
||||
clone_impl! { u8 }
|
||||
clone_impl! { u16 }
|
||||
clone_impl! { u32 }
|
||||
clone_impl! { u64 }
|
||||
clone_impl! { u128 }
|
||||
|
||||
clone_impl! { f32 }
|
||||
clone_impl! { f64 }
|
||||
|
||||
clone_impl! { ! }
|
||||
clone_impl! { () }
|
||||
clone_impl! { bool }
|
||||
clone_impl! { char }
|
||||
|
@ -8,16 +8,6 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[macro_export]
|
||||
// This stability attribute is totally useless.
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[cfg(stage0)]
|
||||
macro_rules! __rust_unstable_column {
|
||||
() => {
|
||||
column!()
|
||||
}
|
||||
}
|
||||
|
||||
/// Entry point of thread panic, for details, see std::macros
|
||||
#[macro_export]
|
||||
#[allow_internal_unstable]
|
||||
|
@ -188,26 +188,6 @@ pub fn forget<T>(t: T) {
|
||||
/// ```
|
||||
#[inline]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[cfg(stage0)]
|
||||
pub fn size_of<T>() -> usize {
|
||||
unsafe { intrinsics::size_of::<T>() }
|
||||
}
|
||||
|
||||
/// Returns the size of a type in bytes.
|
||||
///
|
||||
/// More specifically, this is the offset in bytes between successive
|
||||
/// items of the same type, including alignment padding.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::mem;
|
||||
///
|
||||
/// assert_eq!(4, mem::size_of::<i32>());
|
||||
/// ```
|
||||
#[inline]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[cfg(not(stage0))]
|
||||
pub const fn size_of<T>() -> usize {
|
||||
unsafe { intrinsics::size_of::<T>() }
|
||||
}
|
||||
@ -299,29 +279,6 @@ pub fn min_align_of_val<T: ?Sized>(val: &T) -> usize {
|
||||
/// ```
|
||||
#[inline]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[cfg(stage0)]
|
||||
pub fn align_of<T>() -> usize {
|
||||
unsafe { intrinsics::min_align_of::<T>() }
|
||||
}
|
||||
|
||||
/// Returns the [ABI]-required minimum alignment of a type.
|
||||
///
|
||||
/// Every reference to a value of the type `T` must be a multiple of this number.
|
||||
///
|
||||
/// This is the alignment used for struct fields. It may be smaller than the preferred alignment.
|
||||
///
|
||||
/// [ABI]: https://en.wikipedia.org/wiki/Application_binary_interface
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::mem;
|
||||
///
|
||||
/// assert_eq!(4, mem::align_of::<i32>());
|
||||
/// ```
|
||||
#[inline]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[cfg(not(stage0))]
|
||||
pub const fn align_of<T>() -> usize {
|
||||
unsafe { intrinsics::min_align_of::<T>() }
|
||||
}
|
||||
|
@ -10,8 +10,6 @@
|
||||
|
||||
//! Operations and constants for 32-bits floats (`f32` type)
|
||||
|
||||
#![cfg_attr(stage0, allow(overflowing_literals))]
|
||||
|
||||
#![stable(feature = "rust1", since = "1.0.0")]
|
||||
|
||||
use intrinsics;
|
||||
|
@ -875,36 +875,9 @@ pub fn eq<T: ?Sized>(a: *const T, b: *const T) -> bool {
|
||||
a == b
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[cfg(stage0)]
|
||||
impl<T: ?Sized> Clone for *const T {
|
||||
#[inline]
|
||||
fn clone(&self) -> *const T {
|
||||
*self
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[cfg(stage0)]
|
||||
impl<T: ?Sized> Clone for *mut T {
|
||||
#[inline]
|
||||
fn clone(&self) -> *mut T {
|
||||
*self
|
||||
}
|
||||
}
|
||||
|
||||
// Impls for function pointers
|
||||
macro_rules! fnptr_impls_safety_abi {
|
||||
($FnTy: ty, $($Arg: ident),*) => {
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[cfg(stage0)]
|
||||
impl<Ret, $($Arg),*> Clone for $FnTy {
|
||||
#[inline]
|
||||
fn clone(&self) -> Self {
|
||||
*self
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "fnptr_impls", since = "1.4.0")]
|
||||
impl<Ret, $($Arg),*> PartialEq for $FnTy {
|
||||
#[inline]
|
||||
|
@ -21,14 +21,6 @@ macro_rules! tuple_impls {
|
||||
}
|
||||
)+) => {
|
||||
$(
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[cfg(stage0)]
|
||||
impl<$($T:Clone),+> Clone for ($($T,)+) {
|
||||
fn clone(&self) -> ($($T,)+) {
|
||||
($(self.$idx.clone(),)+)
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<$($T:PartialEq),+> PartialEq for ($($T,)+) where last_type!($($T,)+): ?Sized {
|
||||
#[inline]
|
||||
|
@ -14,16 +14,6 @@
|
||||
//! library. Each macro is available for use when linking against the standard
|
||||
//! library.
|
||||
|
||||
#[macro_export]
|
||||
// This stability attribute is totally useless.
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[cfg(stage0)]
|
||||
macro_rules! __rust_unstable_column {
|
||||
() => {
|
||||
column!()
|
||||
}
|
||||
}
|
||||
|
||||
/// The entry point for panic of Rust threads.
|
||||
///
|
||||
/// This allows a program to to terminate immediately and provide feedback
|
||||
|
@ -522,40 +522,6 @@ pub fn begin_panic_fmt(msg: &fmt::Arguments,
|
||||
begin_panic(s, file_line_col)
|
||||
}
|
||||
|
||||
// FIXME: In PR #42938, we have added the column as info passed to the panic
|
||||
// handling code. For this, we want to break the ABI of begin_panic.
|
||||
// This is not possible to do directly, as the stage0 compiler is hardcoded
|
||||
// to emit a call to begin_panic in src/libsyntax/ext/build.rs, only
|
||||
// with the file and line number being passed, but not the colum number.
|
||||
// By changing the compiler source, we can only affect behaviour of higher
|
||||
// stages. We need to perform the switch over two stage0 replacements, using
|
||||
// a temporary function begin_panic_new while performing the switch:
|
||||
// 0. Before the current switch, we told stage1 onward to emit a call
|
||||
// to begin_panic_new.
|
||||
// 1. Right now, stage0 calls begin_panic_new with the new ABI,
|
||||
// begin_panic stops being used. We have changed begin_panic to
|
||||
// the new ABI, and started to emit calls to begin_panic in higher
|
||||
// stages again, this time with the new ABI.
|
||||
// 2. After the second SNAP, stage0 calls begin_panic with the new ABI,
|
||||
// and we can remove the temporary begin_panic_new function.
|
||||
|
||||
/// This is the entry point of panicking for panic!() and assert!().
|
||||
#[cfg(stage0)]
|
||||
#[unstable(feature = "libstd_sys_internals",
|
||||
reason = "used by the panic! macro",
|
||||
issue = "0")]
|
||||
#[inline(never)] #[cold] // avoid code bloat at the call sites as much as possible
|
||||
pub fn begin_panic_new<M: Any + Send>(msg: M, file_line_col: &(&'static str, u32, u32)) -> ! {
|
||||
// Note that this should be the only allocation performed in this code path.
|
||||
// Currently this means that panic!() on OOM will invoke this code path,
|
||||
// but then again we're not really ready for panic on OOM anyway. If
|
||||
// we do start doing this, then we should propagate this allocation to
|
||||
// be performed in the parent of this thread instead of the thread that's
|
||||
// panicking.
|
||||
|
||||
rust_panic_with_hook(Box::new(msg), file_line_col)
|
||||
}
|
||||
|
||||
/// This is the entry point of panicking for panic!() and assert!().
|
||||
#[unstable(feature = "libstd_sys_internals",
|
||||
reason = "used by the panic! macro",
|
||||
|
@ -25,8 +25,6 @@
|
||||
|
||||
|
||||
// Reexport some of our utilities which are expected by other crates.
|
||||
#[cfg(stage0)]
|
||||
pub use panicking::begin_panic_new;
|
||||
pub use panicking::{begin_panic, begin_panic_fmt, update_panic_count};
|
||||
|
||||
#[cfg(not(test))]
|
||||
|
@ -157,7 +157,7 @@ macro_rules! thread_local {
|
||||
issue = "0")]
|
||||
#[macro_export]
|
||||
#[allow_internal_unstable]
|
||||
#[cfg_attr(not(stage0), allow_internal_unsafe)]
|
||||
#[allow_internal_unsafe]
|
||||
macro_rules! __thread_local_inner {
|
||||
($(#[$attr:meta])* $vis:vis $name:ident, $t:ty, $init:expr) => {
|
||||
$(#[$attr])* $vis static $name: $crate::thread::LocalKey<$t> = {
|
||||
@ -394,9 +394,6 @@ pub mod fast {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
unsafe impl<T> ::marker::Sync for Key<T> { }
|
||||
|
||||
impl<T> Key<T> {
|
||||
pub const fn new() -> Key<T> {
|
||||
Key {
|
||||
|
@ -12,9 +12,9 @@
|
||||
# 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`.
|
||||
|
||||
date: 2017-07-18
|
||||
rustc: beta
|
||||
cargo: beta
|
||||
date: 2017-08-25
|
||||
rustc: nightly
|
||||
cargo: nightly
|
||||
|
||||
# When making a stable release the process currently looks like:
|
||||
#
|
||||
|
@ -65,11 +65,9 @@ const EXCEPTION_PATHS: &'static [&'static str] = &[
|
||||
"src/rtstartup", // Not sure what to do about this. magic stuff for mingw
|
||||
|
||||
// temporary exceptions
|
||||
"src/libstd/rtdeps.rs", // Until rustbuild replaces make
|
||||
"src/libstd/path.rs",
|
||||
"src/libstd/f32.rs",
|
||||
"src/libstd/f64.rs",
|
||||
"src/libstd/lib.rs", // Until next stage0 snapshot bump
|
||||
"src/libstd/sys_common/mod.rs",
|
||||
"src/libstd/sys_common/net.rs",
|
||||
"src/libterm", // Not sure how to make this crate portable, but test needs it
|
||||
|
Loading…
Reference in New Issue
Block a user