Switch to bootstrapping from 1.29 beta

This commit is contained in:
Mark Rousskov
2018-08-01 07:37:38 -06:00
parent 8c069ceba8
commit 683a3db01f
15 changed files with 34 additions and 277 deletions
+1 -1
View File
@@ -24,7 +24,7 @@
use config::Config;
// The version number
pub const CFG_RELEASE_NUM: &str = "1.29.0";
pub const CFG_RELEASE_NUM: &str = "1.30.0";
pub struct GitInfo {
inner: Option<Info>,
+1 -4
View File
@@ -162,10 +162,7 @@ mod boxed {
#[cfg(test)]
mod boxed_test;
pub mod collections;
#[cfg(any(
all(stage0, target_has_atomic = "ptr"),
all(not(stage0), target_has_atomic = "ptr", target_has_atomic = "cas")
))]
#[cfg(all(target_has_atomic = "ptr", target_has_atomic = "cas"))]
pub mod sync;
pub mod rc;
pub mod raw_vec;
+3 -12
View File
@@ -12,16 +12,10 @@
pub use core::task::*;
#[cfg(any(
all(stage0, target_has_atomic = "ptr"),
all(not(stage0), target_has_atomic = "ptr", target_has_atomic = "cas")
))]
#[cfg(all(target_has_atomic = "ptr", target_has_atomic = "cas"))]
pub use self::if_arc::*;
#[cfg(any(
all(stage0, target_has_atomic = "ptr"),
all(not(stage0), target_has_atomic = "ptr", target_has_atomic = "cas")
))]
#[cfg(all(target_has_atomic = "ptr", target_has_atomic = "cas"))]
mod if_arc {
use super::*;
use core::marker::PhantomData;
@@ -53,10 +47,7 @@ unsafe fn wake_local(arc_self: &Arc<Self>) {
}
}
#[cfg(any(
all(stage0, target_has_atomic = "ptr"),
all(not(stage0), target_has_atomic = "ptr", target_has_atomic = "cas")
))]
#[cfg(all(target_has_atomic = "ptr", target_has_atomic = "cas"))]
struct ArcWrapped<T>(PhantomData<T>);
unsafe impl<T: Wake + 'static> UnsafeWake for ArcWrapped<T> {
+1 -5
View File
@@ -19,10 +19,6 @@
use ptr::{self, NonNull};
use num::NonZeroUsize;
#[unstable(feature = "alloc_internals", issue = "0")]
#[cfg(stage0)]
pub type Opaque = u8;
/// Represents the combination of a starting address and
/// a total capacity of the returned block.
#[unstable(feature = "allocator_api", issue = "32838")]
@@ -48,7 +44,7 @@ fn size_align<T>() -> (usize, usize) {
/// use specific allocators with looser requirements.)
#[stable(feature = "alloc_layout", since = "1.28.0")]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[cfg_attr(not(stage0), lang = "alloc_layout")]
#[lang = "alloc_layout"]
pub struct Layout {
// size of the requested block of memory, measured in bytes.
size_: usize,
-2
View File
@@ -1087,11 +1087,9 @@ pub fn volatile_copy_nonoverlapping_memory<T>(dst: *mut T, src: *const T,
/// Perform a volatile load from the `src` pointer
/// The pointer is not required to be aligned.
#[cfg(not(stage0))]
pub fn unaligned_volatile_load<T>(src: *const T) -> T;
/// Perform a volatile store to the `dst` pointer.
/// The pointer is not required to be aligned.
#[cfg(not(stage0))]
pub fn unaligned_volatile_store<T>(dst: *mut T, val: T);
/// Returns the square root of an `f32`
-195
View File
@@ -1,195 +0,0 @@
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
/// A wrapper to inhibit compiler from automatically calling `T`s destructor.
///
/// This wrapper is 0-cost.
///
/// # Examples
///
/// This wrapper helps with explicitly documenting the drop order dependencies between fields of
/// the type:
///
/// ```rust
/// use std::mem::ManuallyDrop;
/// struct Peach;
/// struct Banana;
/// struct Melon;
/// struct FruitBox {
/// // Immediately clear theres something non-trivial going on with these fields.
/// peach: ManuallyDrop<Peach>,
/// melon: Melon, // Field thats independent of the other two.
/// banana: ManuallyDrop<Banana>,
/// }
///
/// impl Drop for FruitBox {
/// fn drop(&mut self) {
/// unsafe {
/// // Explicit ordering in which field destructors are run specified in the intuitive
/// // location the destructor of the structure containing the fields.
/// // Moreover, one can now reorder fields within the struct however much they want.
/// ManuallyDrop::drop(&mut self.peach);
/// ManuallyDrop::drop(&mut self.banana);
/// }
/// // After destructor for `FruitBox` runs (this function), the destructor for Melon gets
/// // invoked in the usual manner, as it is not wrapped in `ManuallyDrop`.
/// }
/// }
/// ```
#[stable(feature = "manually_drop", since = "1.20.0")]
#[allow(unions_with_drop_fields)]
#[derive(Copy)]
pub union ManuallyDrop<T>{ value: T }
impl<T> ManuallyDrop<T> {
/// Wrap a value to be manually dropped.
///
/// # Examples
///
/// ```rust
/// use std::mem::ManuallyDrop;
/// ManuallyDrop::new(Box::new(()));
/// ```
#[stable(feature = "manually_drop", since = "1.20.0")]
#[rustc_const_unstable(feature = "const_manually_drop_new")]
#[inline]
pub const fn new(value: T) -> ManuallyDrop<T> {
ManuallyDrop { value: value }
}
/// Extract the value from the ManuallyDrop container.
///
/// # Examples
///
/// ```rust
/// use std::mem::ManuallyDrop;
/// let x = ManuallyDrop::new(Box::new(()));
/// let _: Box<()> = ManuallyDrop::into_inner(x);
/// ```
#[stable(feature = "manually_drop", since = "1.20.0")]
#[inline]
pub fn into_inner(slot: ManuallyDrop<T>) -> T {
unsafe {
slot.value
}
}
/// Manually drops the contained value.
///
/// # Safety
///
/// This function runs the destructor of the contained value and thus the wrapped value
/// now represents uninitialized data. It is up to the user of this method to ensure the
/// uninitialized data is not actually used.
#[stable(feature = "manually_drop", since = "1.20.0")]
#[inline]
pub unsafe fn drop(slot: &mut ManuallyDrop<T>) {
ptr::drop_in_place(&mut slot.value)
}
}
#[stable(feature = "manually_drop", since = "1.20.0")]
impl<T> Deref for ManuallyDrop<T> {
type Target = T;
#[inline]
fn deref(&self) -> &Self::Target {
unsafe {
&self.value
}
}
}
#[stable(feature = "manually_drop", since = "1.20.0")]
impl<T> DerefMut for ManuallyDrop<T> {
#[inline]
fn deref_mut(&mut self) -> &mut Self::Target {
unsafe {
&mut self.value
}
}
}
#[stable(feature = "manually_drop", since = "1.20.0")]
impl<T: ::fmt::Debug> ::fmt::Debug for ManuallyDrop<T> {
fn fmt(&self, fmt: &mut ::fmt::Formatter) -> ::fmt::Result {
unsafe {
fmt.debug_tuple("ManuallyDrop").field(&self.value).finish()
}
}
}
#[stable(feature = "manually_drop_impls", since = "1.22.0")]
impl<T: Clone> Clone for ManuallyDrop<T> {
fn clone(&self) -> Self {
ManuallyDrop::new(self.deref().clone())
}
fn clone_from(&mut self, source: &Self) {
self.deref_mut().clone_from(source);
}
}
#[stable(feature = "manually_drop_impls", since = "1.22.0")]
impl<T: Default> Default for ManuallyDrop<T> {
fn default() -> Self {
ManuallyDrop::new(Default::default())
}
}
#[stable(feature = "manually_drop_impls", since = "1.22.0")]
impl<T: PartialEq> PartialEq for ManuallyDrop<T> {
fn eq(&self, other: &Self) -> bool {
self.deref().eq(other)
}
fn ne(&self, other: &Self) -> bool {
self.deref().ne(other)
}
}
#[stable(feature = "manually_drop_impls", since = "1.22.0")]
impl<T: Eq> Eq for ManuallyDrop<T> {}
#[stable(feature = "manually_drop_impls", since = "1.22.0")]
impl<T: PartialOrd> PartialOrd for ManuallyDrop<T> {
fn partial_cmp(&self, other: &Self) -> Option<::cmp::Ordering> {
self.deref().partial_cmp(other)
}
fn lt(&self, other: &Self) -> bool {
self.deref().lt(other)
}
fn le(&self, other: &Self) -> bool {
self.deref().le(other)
}
fn gt(&self, other: &Self) -> bool {
self.deref().gt(other)
}
fn ge(&self, other: &Self) -> bool {
self.deref().ge(other)
}
}
#[stable(feature = "manually_drop_impls", since = "1.22.0")]
impl<T: Ord> Ord for ManuallyDrop<T> {
fn cmp(&self, other: &Self) -> ::cmp::Ordering {
self.deref().cmp(other)
}
}
#[stable(feature = "manually_drop_impls", since = "1.22.0")]
impl<T: ::hash::Hash> ::hash::Hash for ManuallyDrop<T> {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.deref().hash(state);
}
}
-7
View File
@@ -953,7 +953,6 @@ pub fn discriminant<T>(v: &T) -> Discriminant<T> {
/// }
/// }
/// ```
#[cfg(not(stage0))]
#[stable(feature = "manually_drop", since = "1.20.0")]
#[lang = "manually_drop"]
#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
@@ -961,10 +960,6 @@ pub struct ManuallyDrop<T> {
value: T,
}
#[cfg(stage0)]
include!("manually_drop_stage0.rs");
#[cfg(not(stage0))]
impl<T> ManuallyDrop<T> {
/// Wrap a value to be manually dropped.
///
@@ -1010,7 +1005,6 @@ pub unsafe fn drop(slot: &mut ManuallyDrop<T>) {
}
}
#[cfg(not(stage0))]
#[stable(feature = "manually_drop", since = "1.20.0")]
impl<T> Deref for ManuallyDrop<T> {
type Target = T;
@@ -1020,7 +1014,6 @@ fn deref(&self) -> &Self::Target {
}
}
#[cfg(not(stage0))]
#[stable(feature = "manually_drop", since = "1.20.0")]
impl<T> DerefMut for ManuallyDrop<T> {
#[inline]
+16 -16
View File
@@ -373,7 +373,7 @@ pub fn store(&self, val: bool, order: Ordering) {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg(any(stage0, target_has_atomic = "cas"))]
#[cfg(target_has_atomic = "cas")]
pub fn swap(&self, val: bool, order: Ordering) -> bool {
unsafe { atomic_swap(self.v.get(), val as u8, order) != 0 }
}
@@ -404,7 +404,7 @@ pub fn swap(&self, val: bool, order: Ordering) -> bool {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg(any(stage0, target_has_atomic = "cas"))]
#[cfg(target_has_atomic = "cas")]
pub fn compare_and_swap(&self, current: bool, new: bool, order: Ordering) -> bool {
match self.compare_exchange(current, new, order, strongest_failure_ordering(order)) {
Ok(x) => x,
@@ -450,7 +450,7 @@ pub fn compare_and_swap(&self, current: bool, new: bool, order: Ordering) -> boo
/// ```
#[inline]
#[stable(feature = "extended_compare_and_swap", since = "1.10.0")]
#[cfg(any(stage0, target_has_atomic = "cas"))]
#[cfg(target_has_atomic = "cas")]
pub fn compare_exchange(&self,
current: bool,
new: bool,
@@ -542,7 +542,7 @@ pub fn compare_exchange_weak(&self,
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg(any(stage0, target_has_atomic = "cas"))]
#[cfg(target_has_atomic = "cas")]
pub fn fetch_and(&self, val: bool, order: Ordering) -> bool {
unsafe { atomic_and(self.v.get(), val as u8, order) != 0 }
}
@@ -574,7 +574,7 @@ pub fn fetch_and(&self, val: bool, order: Ordering) -> bool {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg(any(stage0, target_has_atomic = "cas"))]
#[cfg(target_has_atomic = "cas")]
pub fn fetch_nand(&self, val: bool, order: Ordering) -> bool {
// We can't use atomic_nand here because it can result in a bool with
// an invalid value. This happens because the atomic operation is done
@@ -617,7 +617,7 @@ pub fn fetch_nand(&self, val: bool, order: Ordering) -> bool {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg(any(stage0, target_has_atomic = "cas"))]
#[cfg(target_has_atomic = "cas")]
pub fn fetch_or(&self, val: bool, order: Ordering) -> bool {
unsafe { atomic_or(self.v.get(), val as u8, order) != 0 }
}
@@ -648,7 +648,7 @@ pub fn fetch_or(&self, val: bool, order: Ordering) -> bool {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg(any(stage0, target_has_atomic = "cas"))]
#[cfg(target_has_atomic = "cas")]
pub fn fetch_xor(&self, val: bool, order: Ordering) -> bool {
unsafe { atomic_xor(self.v.get(), val as u8, order) != 0 }
}
@@ -795,7 +795,7 @@ pub fn store(&self, ptr: *mut T, order: Ordering) {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg(any(stage0, target_has_atomic = "cas"))]
#[cfg(target_has_atomic = "cas")]
pub fn swap(&self, ptr: *mut T, order: Ordering) -> *mut T {
unsafe { atomic_swap(self.p.get() as *mut usize, ptr as usize, order) as *mut T }
}
@@ -825,7 +825,7 @@ pub fn swap(&self, ptr: *mut T, order: Ordering) -> *mut T {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg(any(stage0, target_has_atomic = "cas"))]
#[cfg(target_has_atomic = "cas")]
pub fn compare_and_swap(&self, current: *mut T, new: *mut T, order: Ordering) -> *mut T {
match self.compare_exchange(current, new, order, strongest_failure_ordering(order)) {
Ok(x) => x,
@@ -864,7 +864,7 @@ pub fn compare_and_swap(&self, current: *mut T, new: *mut T, order: Ordering) ->
/// ```
#[inline]
#[stable(feature = "extended_compare_and_swap", since = "1.10.0")]
#[cfg(any(stage0, target_has_atomic = "cas"))]
#[cfg(target_has_atomic = "cas")]
pub fn compare_exchange(&self,
current: *mut T,
new: *mut T,
@@ -1151,7 +1151,7 @@ pub fn store(&self, val: $int_type, order: Ordering) {
```"),
#[inline]
#[$stable]
#[cfg(any(stage0, target_has_atomic = "cas"))]
#[cfg(target_has_atomic = "cas")]
pub fn swap(&self, val: $int_type, order: Ordering) -> $int_type {
unsafe { atomic_swap(self.v.get(), val, order) }
}
@@ -1184,7 +1184,7 @@ pub fn swap(&self, val: $int_type, order: Ordering) -> $int_type {
```"),
#[inline]
#[$stable]
#[cfg(any(stage0, target_has_atomic = "cas"))]
#[cfg(target_has_atomic = "cas")]
pub fn compare_and_swap(&self,
current: $int_type,
new: $int_type,
@@ -1238,7 +1238,7 @@ pub fn compare_and_swap(&self,
```"),
#[inline]
#[$stable_cxchg]
#[cfg(any(stage0, target_has_atomic = "cas"))]
#[cfg(target_has_atomic = "cas")]
pub fn compare_exchange(&self,
current: $int_type,
new: $int_type,
@@ -1693,7 +1693,7 @@ pub fn fetch_min(&self, val: $int_type, order: Ordering) -> $int_type {
}
#[inline]
#[cfg(any(stage0, target_has_atomic = "cas"))]
#[cfg(target_has_atomic = "cas")]
fn strongest_failure_ordering(order: Ordering) -> Ordering {
match order {
Release => Relaxed,
@@ -1730,7 +1730,7 @@ unsafe fn atomic_load<T>(dst: *const T, order: Ordering) -> T {
}
#[inline]
#[cfg(any(stage0, target_has_atomic = "cas"))]
#[cfg(target_has_atomic = "cas")]
unsafe fn atomic_swap<T>(dst: *mut T, val: T, order: Ordering) -> T {
match order {
Acquire => intrinsics::atomic_xchg_acq(dst, val),
@@ -1769,7 +1769,7 @@ unsafe fn atomic_sub<T>(dst: *mut T, val: T, order: Ordering) -> T {
}
#[inline]
#[cfg(any(stage0, target_has_atomic = "cas"))]
#[cfg(target_has_atomic = "cas")]
unsafe fn atomic_compare_exchange<T>(dst: *mut T,
old: T,
new: T,
+7 -13
View File
@@ -3753,16 +3753,14 @@ fn lower_expr(&mut self, e: &Expr) -> hir::Expr {
}
// Desugar `<start>..=<end>` to `std::ops::RangeInclusive::new(<start>, <end>)`
ExprKind::Range(Some(ref e1), Some(ref e2), RangeLimits::Closed) => {
// FIXME: Use e.span directly after RangeInclusive::new() is stabilized in stage0.
let span = self.allow_internal_unstable(CompilerDesugaringKind::DotFill, e.span);
let id = self.next_id();
let e1 = self.lower_expr(e1);
let e2 = self.lower_expr(e2);
let ty_path = P(self.std_path(span, &["ops", "RangeInclusive"], None, false));
let ty = P(self.ty_path(id, span, hir::QPath::Resolved(None, ty_path)));
let ty_path = P(self.std_path(e.span, &["ops", "RangeInclusive"], None, false));
let ty = P(self.ty_path(id, e.span, hir::QPath::Resolved(None, ty_path)));
let new_seg = P(hir::PathSegment::from_ident(Ident::from_str("new")));
let new_path = hir::QPath::TypeRelative(ty, new_seg);
let new = P(self.expr(span, hir::ExprKind::Path(new_path), ThinVec::new()));
let new = P(self.expr(e.span, hir::ExprKind::Path(new_path), ThinVec::new()));
hir::ExprKind::Call(new, hir_vec![e1, e2])
}
ExprKind::Range(ref e1, ref e2, lims) => {
@@ -3785,20 +3783,16 @@ fn lower_expr(&mut self, e: &Expr) -> hir::Expr {
.chain(e2.iter().map(|e| ("end", e)))
.map(|(s, e)| {
let expr = P(self.lower_expr(&e));
let unstable_span =
self.allow_internal_unstable(CompilerDesugaringKind::DotFill, e.span);
let ident = Ident::new(Symbol::intern(s), unstable_span);
self.field(ident, expr, unstable_span)
let ident = Ident::new(Symbol::intern(s), e.span);
self.field(ident, expr, e.span)
})
.collect::<P<[hir::Field]>>();
let is_unit = fields.is_empty();
let unstable_span =
self.allow_internal_unstable(CompilerDesugaringKind::DotFill, e.span);
let struct_path = iter::once("ops")
.chain(iter::once(path))
.collect::<Vec<_>>();
let struct_path = self.std_path(unstable_span, &struct_path, None, is_unit);
let struct_path = self.std_path(e.span, &struct_path, None, is_unit);
let struct_path = hir::QPath::Resolved(None, P(struct_path));
let LoweredNodeId { node_id, hir_id } = self.lower_node_id(e.id);
@@ -3811,7 +3805,7 @@ fn lower_expr(&mut self, e: &Expr) -> hir::Expr {
} else {
hir::ExprKind::Struct(struct_path, fields, None)
},
span: unstable_span,
span: e.span,
attrs: e.attrs.clone(),
};
}
-1
View File
@@ -409,7 +409,6 @@ fn hash_token<'a, 'gcx, W: StableHasherResult>(
impl_stable_hash_for!(enum ::syntax_pos::hygiene::CompilerDesugaringKind {
Async,
DotFill,
QuestionMark,
ExistentialReturnType,
ForLoop,
+1 -2
View File
@@ -125,8 +125,7 @@ fn default_alloc_error_hook(layout: Layout) {
#[cfg(not(test))]
#[doc(hidden)]
#[cfg_attr(stage0, lang = "oom")]
#[cfg_attr(not(stage0), alloc_error_handler)]
#[alloc_error_handler]
#[unstable(feature = "alloc_internals", issue = "0")]
pub fn rust_oom(layout: Layout) -> ! {
let hook = HOOK.load(Ordering::SeqCst);
+2 -12
View File
@@ -157,12 +157,7 @@ macro_rules! print {
macro_rules! println {
() => (print!("\n"));
($($arg:tt)*) => ({
#[cfg(not(stage0))] {
($crate::io::_print(format_args_nl!($($arg)*)));
}
#[cfg(stage0)] {
print!("{}\n", format_args!($($arg)*))
}
$crate::io::_print(format_args_nl!($($arg)*));
})
}
@@ -221,12 +216,7 @@ macro_rules! eprint {
macro_rules! eprintln {
() => (eprint!("\n"));
($($arg:tt)*) => ({
#[cfg(all(not(stage0), not(stage1)))] {
($crate::io::_eprint(format_args_nl!($($arg)*)));
}
#[cfg(any(stage0, stage1))] {
eprint!("{}\n", format_args!($($arg)*))
}
$crate::io::_eprint(format_args_nl!($($arg)*));
})
}
-2
View File
@@ -594,7 +594,6 @@ pub fn name(&self) -> Symbol {
/// The kind of compiler desugaring.
#[derive(Clone, Copy, Hash, Debug, PartialEq, Eq, RustcEncodable, RustcDecodable)]
pub enum CompilerDesugaringKind {
DotFill,
QuestionMark,
Catch,
/// Desugaring of an `impl Trait` in return type position
@@ -609,7 +608,6 @@ impl CompilerDesugaringKind {
pub fn name(self) -> Symbol {
Symbol::intern(match self {
CompilerDesugaringKind::Async => "async",
CompilerDesugaringKind::DotFill => "...",
CompilerDesugaringKind::QuestionMark => "?",
CompilerDesugaringKind::Catch => "do catch",
CompilerDesugaringKind::ExistentialReturnType => "existential type",
+1 -1
View File
@@ -12,7 +12,7 @@
# 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: 2018-07-27
date: 2018-08-01
rustc: beta
cargo: beta
+1 -4
View File
@@ -5,8 +5,5 @@ LL | println!("Hello, World!");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: expanding `println! { "Hello, World!" }`
= note: to `{
# [ cfg ( not ( stage0 ) ) ] {
( $crate :: io :: _print ( format_args_nl ! ( "Hello, World!" ) ) ) ; } # [
cfg ( stage0 ) ] { print ! ( "{}/n" , format_args ! ( "Hello, World!" ) ) } }`
= note: to `{ $crate :: io :: _print ( format_args_nl ! ( "Hello, World!" ) ) ; }`