Rollup merge of #40379 - clarcharr:box_docs, r=brson
Box docs: no allocation is done for ZSTs. Updated to add a small bit saying that ZSTs don't actually allocate on `Box::new`.
This commit is contained in:
commit
8f02dc290a
|
@ -225,6 +225,8 @@ impl<T: ?Sized> Drop for IntermediateBox<T> {
|
|||
impl<T> Box<T> {
|
||||
/// Allocates memory on the heap and then places `x` into it.
|
||||
///
|
||||
/// This doesn't actually allocate if `T` is zero-sized.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
|
|
Loading…
Reference in New Issue