boxed: mark from_raw and into_raw functions inline

This commit is contained in:
Stepan Koltsov 2015-02-23 02:58:54 +03:00
parent 852eadc295
commit 554022e583

View File

@ -114,6 +114,7 @@ impl<T : ?Sized> Box<T> {
/// function is called twice on the same raw pointer.
#[unstable(feature = "alloc",
reason = "may be renamed or moved out of Box scope")]
#[inline]
pub unsafe fn from_raw(raw: *mut T) -> Self {
mem::transmute(raw)
}
@ -141,6 +142,7 @@ impl<T : ?Sized> Box<T> {
/// ```
#[unstable(feature = "alloc",
reason = "may be renamed")]
#[inline]
pub unsafe fn into_raw<T : ?Sized>(b: Box<T>) -> *mut T {
mem::transmute(b)
}