Auto merge of #24888 - tamird:snapshot, r=alexcrichton

r? @alexcrichton cc @brson
This commit is contained in:
bors
2015-04-29 02:16:01 +00:00
89 changed files with 29 additions and 397 deletions

View File

@@ -493,7 +493,6 @@ impl<'b> BorrowRef<'b> {
}
}
#[unsafe_destructor]
impl<'b> Drop for BorrowRef<'b> {
#[inline]
fn drop(&mut self) {
@@ -557,7 +556,6 @@ struct BorrowRefMut<'b> {
_borrow: &'b Cell<BorrowFlag>,
}
#[unsafe_destructor]
impl<'b> Drop for BorrowRefMut<'b> {
#[inline]
fn drop(&mut self) {

View File

@@ -34,8 +34,7 @@ mod num;
mod float;
mod builders;
#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))]
#[cfg_attr(not(stage0), unstable(feature = "core", reason = "internal to format_args!"))]
#[unstable(feature = "core", reason = "internal to format_args!")]
#[doc(hidden)]
pub mod rt {
pub mod v1;
@@ -148,8 +147,7 @@ enum Void {}
/// compile time it is ensured that the function and the value have the correct
/// types, and then this struct is used to canonicalize arguments to one type.
#[derive(Copy)]
#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))]
#[cfg_attr(not(stage0), unstable(feature = "core", reason = "internal to format_args!"))]
#[unstable(feature = "core", reason = "internal to format_args!")]
#[doc(hidden)]
pub struct ArgumentV1<'a> {
value: &'a Void,
@@ -169,8 +167,7 @@ impl<'a> ArgumentV1<'a> {
}
#[doc(hidden)]
#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))]
#[cfg_attr(not(stage0), unstable(feature = "core", reason = "internal to format_args!"))]
#[unstable(feature = "core", reason = "internal to format_args!")]
pub fn new<'b, T>(x: &'b T,
f: fn(&T, &mut Formatter) -> Result) -> ArgumentV1<'b> {
unsafe {
@@ -182,8 +179,7 @@ impl<'a> ArgumentV1<'a> {
}
#[doc(hidden)]
#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))]
#[cfg_attr(not(stage0), unstable(feature = "core", reason = "internal to format_args!"))]
#[unstable(feature = "core", reason = "internal to format_args!")]
pub fn from_usize(x: &usize) -> ArgumentV1 {
ArgumentV1::new(x, ArgumentV1::show_usize)
}
@@ -206,8 +202,7 @@ impl<'a> Arguments<'a> {
/// When using the format_args!() macro, this function is used to generate the
/// Arguments structure.
#[doc(hidden)] #[inline]
#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))]
#[cfg_attr(not(stage0), unstable(feature = "core", reason = "internal to format_args!"))]
#[unstable(feature = "core", reason = "internal to format_args!")]
pub fn new_v1(pieces: &'a [&'a str],
args: &'a [ArgumentV1<'a>]) -> Arguments<'a> {
Arguments {
@@ -224,8 +219,7 @@ impl<'a> Arguments<'a> {
/// created with `argumentusize`. However, failing to do so doesn't cause
/// unsafety, but will ignore invalid .
#[doc(hidden)] #[inline]
#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))]
#[cfg_attr(not(stage0), unstable(feature = "core", reason = "internal to format_args!"))]
#[unstable(feature = "core", reason = "internal to format_args!")]
pub fn new_v1_formatted(pieces: &'a [&'a str],
args: &'a [ArgumentV1<'a>],
fmt: &'a [rt::v1::Argument]) -> Arguments<'a> {

View File

@@ -14,69 +14,46 @@
//! These definitions are similar to their `ct` equivalents, but differ in that
//! these can be statically allocated and are slightly optimized for the runtime
#![cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))]
#![cfg_attr(not(stage0), unstable(feature = "core", reason = "internal to format_args!"))]
#![unstable(feature = "core", reason = "internal to format_args!")]
#[derive(Copy, Clone)]
#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))]
pub struct Argument {
#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))]
pub position: Position,
#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))]
pub format: FormatSpec,
}
#[derive(Copy, Clone)]
#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))]
pub struct FormatSpec {
#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))]
pub fill: char,
#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))]
pub align: Alignment,
#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))]
pub flags: u32,
#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))]
pub precision: Count,
#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))]
pub width: Count,
}
/// Possible alignments that can be requested as part of a formatting directive.
#[derive(Copy, Clone, PartialEq)]
#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))]
pub enum Alignment {
/// Indication that contents should be left-aligned.
#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))]
Left,
/// Indication that contents should be right-aligned.
#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))]
Right,
/// Indication that contents should be center-aligned.
#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))]
Center,
/// No alignment was requested.
#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))]
Unknown,
}
#[derive(Copy, Clone)]
#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))]
pub enum Count {
#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))]
Is(usize),
#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))]
Param(usize),
#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))]
NextParam,
#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))]
Implied,
}
#[derive(Copy, Clone)]
#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))]
pub enum Position {
#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))]
Next,
#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))]
At(usize)
}

View File

@@ -303,14 +303,8 @@ extern "rust-intrinsic" {
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg(not(stage0))]
pub fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: usize);
/// dox
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg(stage0)]
pub fn copy_nonoverlapping<T>(dst: *mut T, src: *const T, count: usize);
/// Copies `count * size_of<T>` bytes from `src` to `dst`. The source
/// and destination may overlap.
///
@@ -340,14 +334,8 @@ extern "rust-intrinsic" {
/// ```
///
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg(not(stage0))]
pub fn copy<T>(src: *const T, dst: *mut T, count: usize);
/// dox
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg(stage0)]
pub fn copy<T>(dst: *mut T, src: *const T, count: usize);
/// Invokes memset on the specified pointer, setting `count * size_of::<T>()`
/// bytes of memory starting at `dst` to `c`.
#[stable(feature = "rust1", since = "1.0.0")]
@@ -572,7 +560,5 @@ extern "rust-intrinsic" {
/// Returns the value of the discriminant for the variant in 'v',
/// cast to a `u64`; if `T` has no discriminant, returns 0.
// SNAP 5520801
#[cfg(not(stage0))]
pub fn discriminant_value<T>(v: &T) -> u64;
}

View File

@@ -65,7 +65,7 @@
#![feature(intrinsics, lang_items)]
#![feature(on_unimplemented)]
#![feature(simd, unsafe_destructor)]
#![feature(simd)]
#![feature(staged_api)]
#![feature(unboxed_closures)]
#![feature(rustc_attrs)]

View File

@@ -35,20 +35,10 @@ use hash::Hasher;
#[stable(feature = "rust1", since = "1.0.0")]
#[lang="send"]
#[rustc_on_unimplemented = "`{Self}` cannot be sent between threads safely"]
#[cfg(not(stage0))]
pub unsafe trait Send {
// empty.
}
/// Types able to be transferred across thread boundaries.
#[stable(feature = "rust1", since = "1.0.0")]
#[lang="send"]
#[rustc_on_unimplemented = "`{Self}` cannot be sent between threads safely"]
#[cfg(stage0)]
pub unsafe trait Send : MarkerTrait {
// empty.
}
unsafe impl Send for .. { }
impl<T> !Send for *const T { }
@@ -60,21 +50,10 @@ impl !Send for Managed { }
#[lang="sized"]
#[rustc_on_unimplemented = "`{Self}` does not have a constant size known at compile-time"]
#[fundamental] // for Default, for example, which requires that `[T]: !Default` be evaluatable
#[cfg(not(stage0))]
pub trait Sized {
// Empty.
}
/// Types with a constant size known at compile-time.
#[stable(feature = "rust1", since = "1.0.0")]
#[lang="sized"]
#[rustc_on_unimplemented = "`{Self}` does not have a constant size known at compile-time"]
#[fundamental] // for Default, for example, which requires that `[T]: !Default` be evaluatable
#[cfg(stage0)]
pub trait Sized : MarkerTrait {
// Empty.
}
/// Types that can be copied by simply copying bits (i.e. `memcpy`).
///
/// By default, variable bindings have 'move semantics.' In other
@@ -222,7 +201,6 @@ pub trait Copy : Clone {
/// wrapper around the value(s) which can be mutated when behind a `&`
/// reference; not doing this is undefined behaviour (for example,
/// `transmute`-ing from `&T` to `&mut T` is illegal).
#[cfg(not(stage0))]
#[stable(feature = "rust1", since = "1.0.0")]
#[lang="sync"]
#[rustc_on_unimplemented = "`{Self}` cannot be shared between threads safely"]
@@ -230,15 +208,6 @@ pub unsafe trait Sync {
// Empty
}
/// dox
#[cfg(stage0)]
#[stable(feature = "rust1", since = "1.0.0")]
#[lang="sync"]
#[rustc_on_unimplemented = "`{Self}` cannot be shared between threads safely"]
pub unsafe trait Sync : MarkerTrait {
// Empty
}
unsafe impl Sync for .. { }
impl<T> !Sync for *const T { }
@@ -301,20 +270,6 @@ macro_rules! impls{
)
}
/// dox
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg(stage0)]
pub trait MarkerTrait : PhantomFn<Self,Self> { }
#[cfg(stage0)]
impl<T: ?Sized> MarkerTrait for T {}
/// dox
#[lang="phantom_fn"]
#[cfg(stage0)]
pub trait PhantomFn<A:?Sized,R:?Sized=()> {
}
/// `PhantomData<T>` allows you to describe that a type acts as if it stores a value of type `T`,
/// even though it does not. This allows you to inform the compiler about certain safety properties
/// of your code.
@@ -461,14 +416,6 @@ mod impls {
#[rustc_reflect_like]
#[unstable(feature = "core", reason = "requires RFC and more experience")]
#[allow(deprecated)]
#[cfg(not(stage0))]
pub trait Reflect {}
/// dox
#[rustc_reflect_like]
#[unstable(feature = "core", reason = "requires RFC and more experience")]
#[cfg(stage0)]
pub trait Reflect: MarkerTrait {}
impl Reflect for .. { }

View File

@@ -12,16 +12,10 @@
use marker::Sized;
use ops::Deref;
#[cfg(stage0)] use marker::MarkerTrait;
/// Unsafe trait to indicate what types are usable with the NonZero struct
#[cfg(not(stage0))]
pub unsafe trait Zeroable {}
/// Unsafe trait to indicate what types are usable with the NonZero struct
#[cfg(stage0)]
pub unsafe trait Zeroable: MarkerTrait {}
unsafe impl<T:?Sized> Zeroable for *const T {}
unsafe impl<T:?Sized> Zeroable for *mut T {}
unsafe impl Zeroable for isize {}

View File

@@ -508,8 +508,6 @@ macro_rules! neg_impl_numeric {
macro_rules! neg_impl_unsigned {
($($t:ty)*) => {
neg_impl_core!{ x => {
#[cfg(stage0)]
use ::num::wrapping::WrappingOps;
!x.wrapping_add(1)
}, $($t)*} }
}
@@ -1162,7 +1160,6 @@ pub trait FnOnce<Args> {
extern "rust-call" fn call_once(self, args: Args) -> Self::Output;
}
#[cfg(not(stage0))]
mod impls {
use marker::Sized;
use super::{Fn, FnMut, FnOnce};

View File

@@ -106,28 +106,11 @@ use cmp::Ordering::{self, Less, Equal, Greater};
// FIXME #19649: intrinsic docs don't render, so these have no docs :(
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg(not(stage0))]
pub use intrinsics::copy_nonoverlapping;
/// dox
#[cfg(stage0)]
#[stable(feature = "rust1", since = "1.0.0")]
pub unsafe fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: usize) {
intrinsics::copy_nonoverlapping(dst, src, count)
}
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg(not(stage0))]
pub use intrinsics::copy;
/// dox
#[cfg(stage0)]
#[stable(feature = "rust1", since = "1.0.0")]
pub unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize) {
intrinsics::copy(dst, src, count)
}
#[stable(feature = "rust1", since = "1.0.0")]
pub use intrinsics::write_bytes;