Skip to content

Commit 1ae2efb

Browse files
committed
Added (in)stability markers to newly added POST_DROP_* consts.
(Reviewed rest of code; did not see other `pub` items that needed such treatment.) Driveby: fix typo in comment in ptr.rs.
1 parent 0cf8d12 commit 1ae2efb

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

src/libcore/mem.rs

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -337,19 +337,28 @@ macro_rules! repeat_u8_as_u64 {
337337
// But having the sign bit set is a pain, so 0x1d is probably better.
338338
//
339339
// And of course, 0x00 brings back the old world of zero'ing on drop.
340-
#[cfg(not(stage0))] pub const POST_DROP_U8: u8 = 0x1d;
341-
#[cfg(not(stage0))] pub const POST_DROP_U32: u32 = repeat_u8_as_u32!(POST_DROP_U8);
342-
#[cfg(not(stage0))] pub const POST_DROP_U64: u64 = repeat_u8_as_u64!(POST_DROP_U8);
340+
#[cfg(not(stage0))] #[unstable(feature = "filling_drop")]
341+
pub const POST_DROP_U8: u8 = 0x1d;
342+
#[cfg(not(stage0))] #[unstable(feature = "filling_drop")]
343+
pub const POST_DROP_U32: u32 = repeat_u8_as_u32!(POST_DROP_U8);
344+
#[cfg(not(stage0))] #[unstable(feature = "filling_drop")]
345+
pub const POST_DROP_U64: u64 = repeat_u8_as_u64!(POST_DROP_U8);
343346

344347
#[cfg(target_pointer_width = "32")]
345-
#[cfg(not(stage0))] pub const POST_DROP_USIZE: usize = POST_DROP_U32 as usize;
348+
#[cfg(not(stage0))] #[unstable(feature = "filling_drop")]
349+
pub const POST_DROP_USIZE: usize = POST_DROP_U32 as usize;
346350
#[cfg(target_pointer_width = "64")]
347-
#[cfg(not(stage0))] pub const POST_DROP_USIZE: usize = POST_DROP_U64 as usize;
351+
#[cfg(not(stage0))] #[unstable(feature = "filling_drop")]
352+
pub const POST_DROP_USIZE: usize = POST_DROP_U64 as usize;
348353

349-
#[cfg(stage0)] pub const POST_DROP_U8: u8 = 0;
350-
#[cfg(stage0)] pub const POST_DROP_U32: u32 = 0;
351-
#[cfg(stage0)] pub const POST_DROP_U64: u64 = 0;
352-
#[cfg(stage0)] pub const POST_DROP_USIZE: usize = 0;
354+
#[cfg(stage0)] #[unstable(feature = "filling_drop")]
355+
pub const POST_DROP_U8: u8 = 0;
356+
#[cfg(stage0)] #[unstable(feature = "filling_drop")]
357+
pub const POST_DROP_U32: u32 = 0;
358+
#[cfg(stage0)] #[unstable(feature = "filling_drop")]
359+
pub const POST_DROP_U64: u64 = 0;
360+
#[cfg(stage0)] #[unstable(feature = "filling_drop")]
361+
pub const POST_DROP_USIZE: usize = 0;
353362

354363
/// Interprets `src` as `&U`, and then reads `src` without moving the contained value.
355364
///

src/libcore/ptr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ pub unsafe fn read_and_zero<T>(dest: *mut T) -> T {
246246
}
247247

248248
/// Variant of read_and_zero that writes the specific drop-flag byte
249-
/// (which may be more apropriate than zero).
249+
/// (which may be more appropriate than zero).
250250
#[inline(always)]
251251
#[unstable(feature = "core",
252252
reason = "may play a larger role in std::ptr future extensions")]

0 commit comments

Comments
 (0)