More inline, doc fixes

This commit is contained in:
Manish Goregaokar 2020-12-31 16:48:51 +00:00
parent 8f3cb7d75d
commit 375e7c5864
2 changed files with 3 additions and 2 deletions

View File

@ -269,7 +269,6 @@ pub fn try_new(x: T) -> Result<Self, AllocError> {
/// ```
/// #![feature(allocator_api, new_uninit)]
///
///
/// let mut five = Box::<u32>::try_new_uninit()?;
///
/// let five = unsafe {
@ -284,6 +283,7 @@ pub fn try_new(x: T) -> Result<Self, AllocError> {
/// ```
#[unstable(feature = "allocator_api", issue = "32838")]
// #[unstable(feature = "new_uninit", issue = "63291")]
#[inline]
pub fn try_new_uninit() -> Result<Box<mem::MaybeUninit<T>>, AllocError> {
Box::try_new_uninit_in(Global)
}
@ -309,6 +309,7 @@ pub fn try_new_uninit() -> Result<Box<mem::MaybeUninit<T>>, AllocError> {
/// [zeroed]: mem::MaybeUninit::zeroed
#[unstable(feature = "allocator_api", issue = "32838")]
// #[unstable(feature = "new_uninit", issue = "63291")]
#[inline]
pub fn try_new_zeroed() -> Result<Box<mem::MaybeUninit<T>>, AllocError> {
Box::try_new_zeroed_in(Global)
}

View File

@ -557,7 +557,7 @@ pub fn try_new_uninit() -> Result<Arc<mem::MaybeUninit<T>>, AllocError> {
/// # Ok::<(), std::alloc::AllocError>(())
/// ```
///
/// [zeroed]: ../../std/mem/union.MaybeUninit.html#method.zeroed
/// [zeroed]: mem::MaybeUninit::zeroed
#[unstable(feature = "allocator_api", issue = "32838")]
// #[unstable(feature = "new_uninit", issue = "63291")]
pub fn try_new_zeroed() -> Result<Arc<mem::MaybeUninit<T>>, AllocError> {