diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index 541de2d37fb..b92dfa9117e 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -75,7 +75,7 @@ #![feature(box_syntax)] #![feature(optin_builtin_traits)] #![feature(unboxed_closures)] -#![feature(unsafe_no_drop_flag)] +#![feature(unsafe_no_drop_flag, filling_drop)] #![feature(core)] #![feature(unique)] #![cfg_attr(test, feature(test, alloc, rustc_private))] diff --git a/src/libcollections/lib.rs b/src/libcollections/lib.rs index 6a65c991c95..e32ee34887c 100644 --- a/src/libcollections/lib.rs +++ b/src/libcollections/lib.rs @@ -36,7 +36,7 @@ #![feature(unicode)] #![feature(unsafe_destructor)] #![feature(unique)] -#![feature(unsafe_no_drop_flag)] +#![feature(unsafe_no_drop_flag, filling_drop)] #![feature(step_by)] #![feature(str_char)] #![feature(convert)] diff --git a/src/libcore/mem.rs b/src/libcore/mem.rs index 4b9e070619f..434a5d17a92 100644 --- a/src/libcore/mem.rs +++ b/src/libcore/mem.rs @@ -337,19 +337,28 @@ 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))] pub const POST_DROP_U8: u8 = 0x1d; -#[cfg(not(stage0))] pub const POST_DROP_U32: u32 = repeat_u8_as_u32!(POST_DROP_U8); -#[cfg(not(stage0))] pub const POST_DROP_U64: u64 = repeat_u8_as_u64!(POST_DROP_U8); +#[cfg(not(stage0))] #[unstable(feature = "filling_drop")] +pub const POST_DROP_U8: u8 = 0x1d; +#[cfg(not(stage0))] #[unstable(feature = "filling_drop")] +pub const POST_DROP_U32: u32 = repeat_u8_as_u32!(POST_DROP_U8); +#[cfg(not(stage0))] #[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))] pub const POST_DROP_USIZE: usize = POST_DROP_U32 as usize; +#[cfg(not(stage0))] #[unstable(feature = "filling_drop")] +pub const POST_DROP_USIZE: usize = POST_DROP_U32 as usize; #[cfg(target_pointer_width = "64")] -#[cfg(not(stage0))] pub const POST_DROP_USIZE: usize = POST_DROP_U64 as usize; +#[cfg(not(stage0))] #[unstable(feature = "filling_drop")] +pub const POST_DROP_USIZE: usize = POST_DROP_U64 as usize; -#[cfg(stage0)] pub const POST_DROP_U8: u8 = 0; -#[cfg(stage0)] pub const POST_DROP_U32: u32 = 0; -#[cfg(stage0)] pub const POST_DROP_U64: u64 = 0; -#[cfg(stage0)] pub const POST_DROP_USIZE: usize = 0; +#[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. /// diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index 7a9c9274f3b..07d018dea92 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -231,7 +231,7 @@ pub unsafe fn read_and_zero(dest: *mut T) -> T { } /// Variant of read_and_zero that writes the specific drop-flag byte -/// (which may be more apropriate than zero). +/// (which may be more appropriate than zero). #[inline(always)] #[unstable(feature = "core", reason = "may play a larger role in std::ptr future extensions")] diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index cca6bb747d4..3724b26b202 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -121,7 +121,7 @@ #![feature(unboxed_closures)] #![feature(unicode)] #![feature(unsafe_destructor)] -#![feature(unsafe_no_drop_flag)] +#![feature(unsafe_no_drop_flag, filling_drop)] #![feature(macro_reexport)] #![feature(int_uint)] #![feature(unique)]