We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3c880f2 commit ea6944aCopy full SHA for ea6944a
library/alloc/src/boxed/thin.rs
@@ -67,20 +67,19 @@ impl<T> ThinBox<T> {
67
let ptr = WithOpaqueHeader::new(meta, value);
68
ThinBox { ptr, _marker: PhantomData }
69
}
70
-}
71
72
-#[unstable(feature = "thin_box", issue = "92791")]
73
-impl<T> ThinBox<T> {
74
/// Moves a type to the heap with its [`Metadata`] stored in the heap allocation instead of on
75
/// the stack. Returns an error if allocation fails, instead of aborting.
76
///
77
/// # Examples
78
79
/// ```
+ /// #![feature(allocator_api)]
80
/// #![feature(thin_box)]
81
/// use std::boxed::ThinBox;
82
83
- /// let five = ThinBox::new(5);
+ /// let five = ThinBox::try_new(5)?;
+ /// # Ok::<(), std::alloc::AllocError>(())
84
85
86
/// [`Metadata`]: core::ptr::Pointee::Metadata
0 commit comments