Skip to content

Commit

Permalink
Rollup merge of rust-lang#40379 - clarcharr:box_docs, r=brson
Browse files Browse the repository at this point in the history
Box docs: no allocation is done for ZSTs.

Updated to add a small bit saying that ZSTs don't actually allocate on `Box::new`.
  • Loading branch information
alexcrichton committed Mar 11, 2017
2 parents 9b97a83 + edf5dc6 commit 1910fec
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/liballoc/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
/// ```
Expand Down

0 comments on commit 1910fec

Please sign in to comment.