diff options
| author | Eduard Burtescu <edy.burt@gmail.com> | 2015-05-25 20:21:29 +0300 |
|---|---|---|
| committer | Eduard Burtescu <edy.burt@gmail.com> | 2015-05-27 11:19:02 +0300 |
| commit | 6e8e4f847c2ea02fec021ea15dfb2de6beac797a (patch) | |
| tree | 7831f2de833ae0151217710dc87b2ba03a3bc128 /src/libcore | |
| parent | 07503dfb8bd60e2047a0a5083dd5377f9f14b77d (diff) | |
| download | rust-6e8e4f847c2ea02fec021ea15dfb2de6beac797a.tar.gz rust-6e8e4f847c2ea02fec021ea15dfb2de6beac797a.zip | |
Remove #[cfg(stage0)] items.
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/intrinsics.rs | 19 | ||||
| -rw-r--r-- | src/libcore/marker.rs | 1 | ||||
| -rw-r--r-- | src/libcore/mem.rs | 34 | ||||
| -rw-r--r-- | src/libcore/nonzero.rs | 5 | ||||
| -rw-r--r-- | src/libcore/ops.rs | 15 | ||||
| -rw-r--r-- | src/libcore/slice.rs | 13 |
6 files changed, 6 insertions, 81 deletions
diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs index fa432e311eb..88a686ec255 100644 --- a/src/libcore/intrinsics.rs +++ b/src/libcore/intrinsics.rs @@ -145,13 +145,9 @@ extern "rust-intrinsic" { /// but no instructions will be emitted for it. This is appropriate for operations /// on the same thread that may be preempted, such as when interacting with signal /// handlers. - #[cfg(not(stage0))] // SNAP 857ef6e pub fn atomic_singlethreadfence(); - #[cfg(not(stage0))] // SNAP 857ef6e pub fn atomic_singlethreadfence_acq(); - #[cfg(not(stage0))] // SNAP 857ef6e pub fn atomic_singlethreadfence_rel(); - #[cfg(not(stage0))] // SNAP 857ef6e pub fn atomic_singlethreadfence_acqrel(); /// Aborts the execution of the process. @@ -193,11 +189,8 @@ extern "rust-intrinsic" { pub fn min_align_of<T>() -> usize; pub fn pref_align_of<T>() -> usize; - #[cfg(not(stage0))] pub fn size_of_val<T: ?Sized>(_: &T) -> usize; - #[cfg(not(stage0))] pub fn min_align_of_val<T: ?Sized>(_: &T) -> usize; - #[cfg(not(stage0))] pub fn drop_in_place<T: ?Sized>(_: *mut T); /// Gets a static string slice containing the name of a type. @@ -294,7 +287,6 @@ extern "rust-intrinsic" { /// resulting pointer to point into or one byte past the end of an allocated /// object, and it wraps with two's complement arithmetic. The resulting /// value is not necessarily valid to be used to actually access memory. - #[cfg(not(stage0))] pub fn arith_offset<T>(dst: *const T, offset: isize) -> *const T; /// Copies `count * size_of<T>` bytes from `src` to `dst`. The source @@ -592,13 +584,6 @@ extern "rust-intrinsic" { /// Returns (a * b) mod 2^N, where N is the width of N in bits. pub fn overflowing_mul<T>(a: T, b: T) -> T; - /// Returns the value of the discriminant for the variant in 'v', - /// cast to a `u64`; if `T` has no discriminant, returns 0. - pub fn discriminant_value<T>(v: &T) -> u64; -} - -#[cfg(not(stage0))] -extern "rust-intrinsic" { /// Performs an unchecked signed division, which results in undefined behavior, /// in cases where y == 0, or x == int::MIN and y == -1 pub fn unchecked_sdiv<T>(x: T, y: T) -> T; @@ -612,4 +597,8 @@ extern "rust-intrinsic" { /// Returns the remainder of an unchecked signed division, which results in /// undefined behavior, in cases where y == 0 pub fn unchecked_srem<T>(x: T, y: T) -> T; + + /// Returns the value of the discriminant for the variant in 'v', + /// cast to a `u64`; if `T` has no discriminant, returns 0. + pub fn discriminant_value<T>(v: &T) -> u64; } diff --git a/src/libcore/marker.rs b/src/libcore/marker.rs index 86e91df38ab..bc0f3045972 100644 --- a/src/libcore/marker.rs +++ b/src/libcore/marker.rs @@ -55,7 +55,6 @@ pub trait Sized { /// Types that can be "unsized" to a dynamically sized type. #[unstable(feature = "core")] -#[cfg(not(stage0))] #[lang="unsize"] pub trait Unsize<T> { // Empty. diff --git a/src/libcore/mem.rs b/src/libcore/mem.rs index 173b73fdb09..7749d053285 100644 --- a/src/libcore/mem.rs +++ b/src/libcore/mem.rs @@ -95,29 +95,12 @@ pub fn size_of<T>() -> usize { /// /// assert_eq!(4, mem::size_of_val(&5i32)); /// ``` -#[cfg(not(stage0))] #[inline] #[stable(feature = "rust1", since = "1.0.0")] pub fn size_of_val<T: ?Sized>(val: &T) -> usize { unsafe { intrinsics::size_of_val(val) } } -/// Returns the size of the type that `_val` points to in bytes. -/// -/// # Examples -/// -/// ``` -/// use std::mem; -/// -/// assert_eq!(4, mem::size_of_val(&5i32)); -/// ``` -#[cfg(stage0)] -#[inline] -#[stable(feature = "rust1", since = "1.0.0")] -pub fn size_of_val<T>(_val: &T) -> usize { - size_of::<T>() -} - /// Returns the ABI-required minimum alignment of a type /// /// This is the alignment used for struct fields. It may be smaller than the preferred alignment. @@ -144,29 +127,12 @@ pub fn min_align_of<T>() -> usize { /// /// assert_eq!(4, mem::min_align_of_val(&5i32)); /// ``` -#[cfg(not(stage0))] #[inline] #[stable(feature = "rust1", since = "1.0.0")] pub fn min_align_of_val<T: ?Sized>(val: &T) -> usize { unsafe { intrinsics::min_align_of_val(val) } } -/// Returns the ABI-required minimum alignment of the type of the value that `_val` points to -/// -/// # Examples -/// -/// ``` -/// use std::mem; -/// -/// assert_eq!(4, mem::min_align_of_val(&5i32)); -/// ``` -#[cfg(stage0)] -#[inline] -#[stable(feature = "rust1", since = "1.0.0")] -pub fn min_align_of_val<T>(_val: &T) -> usize { - min_align_of::<T>() -} - /// Returns the alignment in memory for a type. /// /// This function will return the alignment, in bytes, of a type in memory. If the alignment diff --git a/src/libcore/nonzero.rs b/src/libcore/nonzero.rs index 59819fd500d..32522794254 100644 --- a/src/libcore/nonzero.rs +++ b/src/libcore/nonzero.rs @@ -11,9 +11,7 @@ //! Exposes the NonZero lang item which provides optimization hints. use marker::Sized; -use ops::Deref; -#[cfg(not(stage0))] -use ops::CoerceUnsized; +use ops::{CoerceUnsized, Deref}; /// Unsafe trait to indicate what types are usable with the NonZero struct pub unsafe trait Zeroable {} @@ -57,5 +55,4 @@ impl<T: Zeroable> Deref for NonZero<T> { } } -#[cfg(not(stage0))] impl<T: Zeroable+CoerceUnsized<U>, U: Zeroable> CoerceUnsized<NonZero<U>> for NonZero<T> {} diff --git a/src/libcore/ops.rs b/src/libcore/ops.rs index f16614cfd09..c52f4de732f 100644 --- a/src/libcore/ops.rs +++ b/src/libcore/ops.rs @@ -67,12 +67,9 @@ #![stable(feature = "rust1", since = "1.0.0")] -use marker::Sized; +use marker::{Sized, Unsize}; use fmt; -#[cfg(not(stage0))] -use marker::Unsize; - /// The `Drop` trait is used to run some code when a value goes out of scope. This /// is sometimes called a 'destructor'. /// @@ -1214,39 +1211,29 @@ mod impls { /// Trait that indicates that this is a pointer or a wrapper for one, /// where unsizing can be performed on the pointee. #[unstable(feature = "core")] -#[cfg(not(stage0))] #[lang="coerce_unsized"] pub trait CoerceUnsized<T> { // Empty. } // &mut T -> &mut U -#[cfg(not(stage0))] impl<'a, T: ?Sized+Unsize<U>, U: ?Sized> CoerceUnsized<&'a mut U> for &'a mut T {} // &mut T -> &U -#[cfg(not(stage0))] impl<'a, 'b: 'a, T: ?Sized+Unsize<U>, U: ?Sized> CoerceUnsized<&'a U> for &'b mut T {} // &mut T -> *mut U -#[cfg(not(stage0))] impl<'a, T: ?Sized+Unsize<U>, U: ?Sized> CoerceUnsized<*mut U> for &'a mut T {} // &mut T -> *const U -#[cfg(not(stage0))] impl<'a, T: ?Sized+Unsize<U>, U: ?Sized> CoerceUnsized<*const U> for &'a mut T {} // &T -> &U -#[cfg(not(stage0))] impl<'a, 'b: 'a, T: ?Sized+Unsize<U>, U: ?Sized> CoerceUnsized<&'a U> for &'b T {} // &T -> *const U -#[cfg(not(stage0))] impl<'a, T: ?Sized+Unsize<U>, U: ?Sized> CoerceUnsized<*const U> for &'a T {} // *mut T -> *mut U -#[cfg(not(stage0))] impl<T: ?Sized+Unsize<U>, U: ?Sized> CoerceUnsized<*mut U> for *mut T {} // *mut T -> *const U -#[cfg(not(stage0))] impl<T: ?Sized+Unsize<U>, U: ?Sized> CoerceUnsized<*const U> for *mut T {} // *const T -> *const U -#[cfg(not(stage0))] impl<T: ?Sized+Unsize<U>, U: ?Sized> CoerceUnsized<*const U> for *const T {} diff --git a/src/libcore/slice.rs b/src/libcore/slice.rs index cbac70921b7..2dc28a4786f 100644 --- a/src/libcore/slice.rs +++ b/src/libcore/slice.rs @@ -125,19 +125,6 @@ pub trait SliceExt { } // Use macros to be generic over const/mut -#[cfg(stage0)] -macro_rules! slice_offset { - ($ptr:expr, $by:expr) => {{ - let ptr = $ptr; - if size_from_ptr(ptr) == 0 { - transmute((ptr as isize).wrapping_add($by)) - } else { - ptr.offset($by) - } - }}; -} - -#[cfg(not(stage0))] macro_rules! slice_offset { ($ptr:expr, $by:expr) => {{ let ptr = $ptr; |
