File tree 1 file changed +3
-7
lines changed
1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -139,24 +139,20 @@ impl<T : ?Sized> Box<T> {
139
139
/// convert pointer back to `Box` with `Box::from_raw` function, because
140
140
/// `Box` does not specify, how memory is allocated.
141
141
///
142
- /// Function is unsafe, because result of this function is no longer
143
- /// automatically managed that may lead to memory or other resource
144
- /// leak.
145
- ///
146
142
/// # Examples
147
143
/// ```
148
144
/// # #![feature(alloc)]
149
145
/// use std::boxed;
150
146
///
151
147
/// let seventeen = Box::new(17u32);
152
- /// let raw = unsafe { boxed::into_raw(seventeen) } ;
148
+ /// let raw = boxed::into_raw(seventeen);
153
149
/// let boxed_again = unsafe { Box::from_raw(raw) };
154
150
/// ```
155
151
#[ unstable( feature = "alloc" ,
156
152
reason = "may be renamed" ) ]
157
153
#[ inline]
158
- pub unsafe fn into_raw < T : ?Sized > ( b : Box < T > ) -> * mut T {
159
- mem:: transmute ( b)
154
+ pub fn into_raw < T : ?Sized > ( b : Box < T > ) -> * mut T {
155
+ unsafe { mem:: transmute ( b) }
160
156
}
161
157
162
158
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
You can’t perform that action at this time.
0 commit comments