Skip to content

Commit

Permalink
doc: apply suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
woodruffw committed Dec 11, 2020
1 parent 9cf2516 commit d986924
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions library/alloc/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
/// to the same boxed integer value, not five references pointing to independently
/// boxed integers.
///
/// Also, note that `[T; 0]` is a valid initializer. This will initialize (or call)
/// `T` but not populate the vector with it, so be mindful of side effects.
/// Also, note that `vec![expr; 0]` is allowed, and produces an empty vector.
/// This will still evaluate `expr`, however, and immediately drop the resulting value, so
/// be mindful of side effects.
///
/// [`Vec`]: crate::vec::Vec
#[cfg(not(test))]
Expand Down
5 changes: 3 additions & 2 deletions library/std/src/primitive_docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,9 @@ mod prim_pointer {}
/// * A repeat expression `[x; N]`, which produces an array with `N` copies of `x`.
/// The type of `x` must be [`Copy`].
///
/// Note that `[x; 0]` is a valid repeat expression. This will produce an empty array
/// but will also initialize (or call) `x`, which may produce side effects.
/// Note that `[expr; 0]` is allowed, and produces an empty array.
/// This will still evaluate `expr`, however, and immediately drop the resulting value, so
/// be mindful of side effects.
///
/// Arrays of *any* size implement the following traits if the element type allows it:
///
Expand Down

0 comments on commit d986924

Please sign in to comment.