File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 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> {
6767 let ptr = WithOpaqueHeader :: new ( meta, value) ;
6868 ThinBox { ptr, _marker : PhantomData }
6969 }
70- }
7170
72- #[ unstable( feature = "thin_box" , issue = "92791" ) ]
73- impl < T > ThinBox < T > {
7471 /// Moves a type to the heap with its [`Metadata`] stored in the heap allocation instead of on
7572 /// the stack. Returns an error if allocation fails, instead of aborting.
7673 ///
7774 /// # Examples
7875 ///
7976 /// ```
77+ /// #![feature(allocator_api)]
8078 /// #![feature(thin_box)]
8179 /// use std::boxed::ThinBox;
8280 ///
83- /// let five = ThinBox::new(5);
81+ /// let five = ThinBox::try_new(5)?;
82+ /// # Ok::<(), std::alloc::AllocError>(())
8483 /// ```
8584 ///
8685 /// [`Metadata`]: core::ptr::Pointee::Metadata
You can’t perform that action at this time.
0 commit comments