Commit ea6944a 1 parent 3c880f2 commit ea6944a Copy full SHA for ea6944a
File tree 1 file changed +3
-4
lines changed
1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -67,20 +67,19 @@ impl<T> ThinBox<T> {
67
67
let ptr = WithOpaqueHeader :: new ( meta, value) ;
68
68
ThinBox { ptr, _marker : PhantomData }
69
69
}
70
- }
71
70
72
- #[ unstable( feature = "thin_box" , issue = "92791" ) ]
73
- impl < T > ThinBox < T > {
74
71
/// Moves a type to the heap with its [`Metadata`] stored in the heap allocation instead of on
75
72
/// the stack. Returns an error if allocation fails, instead of aborting.
76
73
///
77
74
/// # Examples
78
75
///
79
76
/// ```
77
+ /// #![feature(allocator_api)]
80
78
/// #![feature(thin_box)]
81
79
/// use std::boxed::ThinBox;
82
80
///
83
- /// let five = ThinBox::new(5);
81
+ /// let five = ThinBox::try_new(5)?;
82
+ /// # Ok::<(), std::alloc::AllocError>(())
84
83
/// ```
85
84
///
86
85
/// [`Metadata`]: core::ptr::Pointee::Metadata
You can’t perform that action at this time.
0 commit comments