diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-03-31 10:26:25 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-03-31 15:53:25 -0700 |
| commit | 94137a37e90f2fc5faf725965b419944e14ad271 (patch) | |
| tree | f8423c7d6d8af63c531dcaf923fbf69795337610 /src/libcore | |
| parent | e3f2d45cb38a89172c423aba07ce270b1a04984f (diff) | |
| download | rust-94137a37e90f2fc5faf725965b419944e14ad271.tar.gz rust-94137a37e90f2fc5faf725965b419944e14ad271.zip | |
Test fixes and rebase conflicts, round 1
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/intrinsics.rs | 1 | ||||
| -rw-r--r-- | src/libcore/marker.rs | 4 | ||||
| -rw-r--r-- | src/libcore/mem.rs | 45 |
3 files changed, 17 insertions, 33 deletions
diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs index 43cf64bf3ad..0e91eafce18 100644 --- a/src/libcore/intrinsics.rs +++ b/src/libcore/intrinsics.rs @@ -197,7 +197,6 @@ extern "rust-intrinsic" { /// Rust moves to non-zeroing dynamic drop (and thus removes the /// embedded drop flags that are being established by this /// intrinsic). - #[cfg(not(stage0))] pub fn init_dropped<T>() -> T; /// Create a value initialized to zero. diff --git a/src/libcore/marker.rs b/src/libcore/marker.rs index 3f4b39da4b3..277b98f0523 100644 --- a/src/libcore/marker.rs +++ b/src/libcore/marker.rs @@ -487,9 +487,5 @@ pub struct InvariantType<T>; pub trait Reflect : MarkerTrait { } -#[cfg(stage0)] -impl<T> Reflect for T { } - -#[cfg(not(stage0))] impl Reflect for .. { } diff --git a/src/libcore/mem.rs b/src/libcore/mem.rs index 98e8668239b..249beb6295c 100644 --- a/src/libcore/mem.rs +++ b/src/libcore/mem.rs @@ -173,11 +173,6 @@ pub unsafe fn zeroed<T>() -> T { #[inline] #[unstable(feature = "filling_drop")] pub unsafe fn dropped<T>() -> T { - #[cfg(stage0)] - #[inline(always)] - unsafe fn dropped_impl<T>() -> T { zeroed() } - - #[cfg(not(stage0))] #[inline(always)] unsafe fn dropped_impl<T>() -> T { intrinsics::init_dropped() } @@ -337,38 +332,32 @@ macro_rules! repeat_u8_as_u64 { // But having the sign bit set is a pain, so 0x1d is probably better. // // And of course, 0x00 brings back the old world of zero'ing on drop. -#[cfg(not(stage0))] #[unstable(feature = "filling_drop")] +#[unstable(feature = "filling_drop")] pub const POST_DROP_U8: u8 = 0x1d; -#[cfg(not(stage0))] #[unstable(feature = "filling_drop")] +#[unstable(feature = "filling_drop")] pub const POST_DROP_U32: u32 = repeat_u8_as_u32!(POST_DROP_U8); -#[cfg(not(stage0))] #[unstable(feature = "filling_drop")] +#[unstable(feature = "filling_drop")] pub const POST_DROP_U64: u64 = repeat_u8_as_u64!(POST_DROP_U8); #[cfg(target_pointer_width = "32")] -#[cfg(not(stage0))] #[unstable(feature = "filling_drop")] +#[unstable(feature = "filling_drop")] pub const POST_DROP_USIZE: usize = POST_DROP_U32 as usize; #[cfg(target_pointer_width = "64")] -#[cfg(not(stage0))] #[unstable(feature = "filling_drop")] +#[unstable(feature = "filling_drop")] pub const POST_DROP_USIZE: usize = POST_DROP_U64 as usize; -#[cfg(stage0)] #[unstable(feature = "filling_drop")] -pub const POST_DROP_U8: u8 = 0; -#[cfg(stage0)] #[unstable(feature = "filling_drop")] -pub const POST_DROP_U32: u32 = 0; -#[cfg(stage0)] #[unstable(feature = "filling_drop")] -pub const POST_DROP_U64: u64 = 0; -#[cfg(stage0)] #[unstable(feature = "filling_drop")] -pub const POST_DROP_USIZE: usize = 0; - -/// Interprets `src` as `&U`, and then reads `src` without moving the contained value. -/// -/// This function will unsafely assume the pointer `src` is valid for `sizeof(U)` bytes by -/// transmuting `&T` to `&U` and then reading the `&U`. It will also unsafely create a copy of the -/// contained value instead of moving out of `src`. -/// -/// It is not a compile-time error if `T` and `U` have different sizes, but it is highly encouraged -/// to only invoke this function where `T` and `U` have the same size. This function triggers -/// undefined behavior if `U` is larger than `T`. +/// Interprets `src` as `&U`, and then reads `src` without moving the contained +/// value. +/// +/// This function will unsafely assume the pointer `src` is valid for +/// `sizeof(U)` bytes by transmuting `&T` to `&U` and then reading the `&U`. It +/// will also unsafely create a copy of the contained value instead of moving +/// out of `src`. +/// +/// It is not a compile-time error if `T` and `U` have different sizes, but it +/// is highly encouraged to only invoke this function where `T` and `U` have the +/// same size. This function triggers undefined behavior if `U` is larger than +/// `T`. /// /// # Examples /// |
