@@ -241,27 +241,6 @@ pub unsafe fn zeroed<T>() -> T {
241241 intrinsics:: init ( )
242242}
243243
244- /// Creates a value initialized to an unspecified series of bytes.
245- ///
246- /// The byte sequence usually indicates that the value at the memory
247- /// in question has been dropped. Thus, *if* T carries a drop flag,
248- /// any associated destructor will not be run when the value falls out
249- /// of scope.
250- ///
251- /// Some code at one time used the `zeroed` function above to
252- /// accomplish this goal.
253- ///
254- /// This function is expected to be deprecated with the transition
255- /// to non-zeroing drop.
256- #[ inline]
257- #[ unstable( feature = "filling_drop" , issue = "5016" ) ]
258- pub unsafe fn dropped < T > ( ) -> T {
259- #[ inline( always) ]
260- unsafe fn dropped_impl < T > ( ) -> T { intrinsics:: init_dropped ( ) }
261-
262- dropped_impl ( )
263- }
264-
265244/// Bypasses Rust's normal memory-initialization checks by pretending to
266245/// produce a value of type T, while doing nothing at all.
267246///
@@ -518,56 +497,6 @@ pub fn replace<T>(dest: &mut T, mut src: T) -> T {
518497#[ stable( feature = "rust1" , since = "1.0.0" ) ]
519498pub fn drop < T > ( _x : T ) { }
520499
521- macro_rules! repeat_u8_as_u16 {
522- ( $name: expr) => { ( ( $name as u16 ) << 8 |
523- ( $name as u16 ) ) }
524- }
525- macro_rules! repeat_u8_as_u32 {
526- ( $name: expr) => { ( ( $name as u32 ) << 24 |
527- ( $name as u32 ) << 16 |
528- ( $name as u32 ) << 8 |
529- ( $name as u32 ) ) }
530- }
531- macro_rules! repeat_u8_as_u64 {
532- ( $name: expr) => { ( ( repeat_u8_as_u32!( $name) as u64 ) << 32 |
533- ( repeat_u8_as_u32!( $name) as u64 ) ) }
534- }
535-
536- // NOTE: Keep synchronized with values used in librustc_trans::trans::adt.
537- //
538- // In particular, the POST_DROP_U8 marker must never equal the
539- // DTOR_NEEDED_U8 marker.
540- //
541- // For a while pnkfelix was using 0xc1 here.
542- // But having the sign bit set is a pain, so 0x1d is probably better.
543- //
544- // And of course, 0x00 brings back the old world of zero'ing on drop.
545- #[ unstable( feature = "filling_drop" , issue = "5016" ) ]
546- #[ allow( missing_docs) ]
547- pub const POST_DROP_U8 : u8 = 0x1d ;
548- #[ unstable( feature = "filling_drop" , issue = "5016" ) ]
549- #[ allow( missing_docs) ]
550- pub const POST_DROP_U16 : u16 = repeat_u8_as_u16 ! ( POST_DROP_U8 ) ;
551- #[ unstable( feature = "filling_drop" , issue = "5016" ) ]
552- #[ allow( missing_docs) ]
553- pub const POST_DROP_U32 : u32 = repeat_u8_as_u32 ! ( POST_DROP_U8 ) ;
554- #[ unstable( feature = "filling_drop" , issue = "5016" ) ]
555- #[ allow( missing_docs) ]
556- pub const POST_DROP_U64 : u64 = repeat_u8_as_u64 ! ( POST_DROP_U8 ) ;
557-
558- #[ cfg( target_pointer_width = "16" ) ]
559- #[ unstable( feature = "filling_drop" , issue = "5016" ) ]
560- #[ allow( missing_docs) ]
561- pub const POST_DROP_USIZE : usize = POST_DROP_U16 as usize ;
562- #[ cfg( target_pointer_width = "32" ) ]
563- #[ unstable( feature = "filling_drop" , issue = "5016" ) ]
564- #[ allow( missing_docs) ]
565- pub const POST_DROP_USIZE : usize = POST_DROP_U32 as usize ;
566- #[ cfg( target_pointer_width = "64" ) ]
567- #[ unstable( feature = "filling_drop" , issue = "5016" ) ]
568- #[ allow( missing_docs) ]
569- pub const POST_DROP_USIZE : usize = POST_DROP_U64 as usize ;
570-
571500/// Interprets `src` as `&U`, and then reads `src` without moving the contained
572501/// value.
573502///
0 commit comments