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
Ariel Ben-Yehuda authored Mar 10, 2017
2 parents d5db32c + edf5dc6 commit 65738a1
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 65738a1

Please sign in to comment.