about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2017-03-10 16:51:40 -0600
committerAlex Crichton <alex@alexcrichton.com>2017-03-10 20:04:58 -0800
commit8f02dc290a4fc2f6df14731a03aae685173a4cbf (patch)
tree92d23e1cec9e854becd5b8241b92903c22463a21 /src
parent2b1d1bbf2abf2aac43f1eaa426f5597ea6a8bc4d (diff)
parentedf5dc66c1ec243bb2a60385b094cde719c0a492 (diff)
downloadrust-8f02dc290a4fc2f6df14731a03aae685173a4cbf.tar.gz
rust-8f02dc290a4fc2f6df14731a03aae685173a4cbf.zip
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`.
Diffstat (limited to 'src')
-rw-r--r--src/liballoc/boxed.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs
index d0fce706128..43b0d72186a 100644
--- a/src/liballoc/boxed.rs
+++ b/src/liballoc/boxed.rs
@@ -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
     ///
     /// ```