diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs index 2fc4d23e7fd7..e2afee9905d7 100644 --- a/src/libcore/intrinsics.rs +++ b/src/libcore/intrinsics.rs @@ -217,6 +217,7 @@ extern "rust-intrinsic" { /// /// `forget` is unsafe because the caller is responsible for /// ensuring the argument is deallocated already. + #[stable] pub fn forget(_: T) -> (); /// Unsafely transforms a value of one type into a value of another type. @@ -232,6 +233,7 @@ extern "rust-intrinsic" { /// let v: &[u8] = unsafe { mem::transmute("L") }; /// assert!(v == [76u8]); /// ``` + #[stable] pub fn transmute(e: T) -> U; /// Gives the address for the return value of the enclosing function. diff --git a/src/libcore/mem.rs b/src/libcore/mem.rs index 937f73a32627..6747d12e0284 100644 --- a/src/libcore/mem.rs +++ b/src/libcore/mem.rs @@ -13,9 +13,13 @@ //! This module contains functions for querying the size and alignment of //! types, initializing and manipulating memory. +#![stable] + +use kinds::Sized; use intrinsics; use ptr; +#[stable] pub use intrinsics::transmute; /// Moves a thing into the void. @@ -223,7 +227,8 @@ pub unsafe fn transmute_copy(src: &T) -> U { #[inline] #[unstable = "this function may be removed in the future due to its \ questionable utility"] -pub unsafe fn copy_lifetime<'a, S, T:'a>(_ptr: &'a S, ptr: &T) -> &'a T { +pub unsafe fn copy_lifetime<'a, Sized? S, Sized? T: 'a>(_ptr: &'a S, + ptr: &T) -> &'a T { transmute(ptr) } @@ -231,7 +236,8 @@ pub unsafe fn copy_lifetime<'a, S, T:'a>(_ptr: &'a S, ptr: &T) -> &'a T { #[inline] #[unstable = "this function may be removed in the future due to its \ questionable utility"] -pub unsafe fn copy_mut_lifetime<'a, S, T:'a>(_ptr: &'a mut S, - ptr: &mut T) -> &'a mut T { +pub unsafe fn copy_mut_lifetime<'a, Sized? S, Sized? T: 'a>(_ptr: &'a mut S, + ptr: &mut T) + -> &'a mut T { transmute(ptr) }