提交 554022e5 编写于 作者: S Stepan Koltsov

boxed: mark from_raw and into_raw functions inline

上级 852eadc2
......@@ -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 @@ pub unsafe fn from_raw(raw: *mut T) -> Self {
/// ```
#[unstable(feature = "alloc",
reason = "may be renamed")]
#[inline]
pub unsafe fn into_raw<T : ?Sized>(b: Box<T>) -> *mut T {
mem::transmute(b)
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册