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:
Alex Crichton 2017-03-10 16:51:40 -06:00
commit 8f02dc290a
1 changed files with 2 additions and 0 deletions

View File

@ -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
///
/// ```