diff options
| author | William Woodruff <william@trailofbits.com> | 2020-12-11 10:09:40 -0500 |
|---|---|---|
| committer | William Woodruff <william@trailofbits.com> | 2020-12-11 10:09:40 -0500 |
| commit | d986924eb13a103fc79c474eded47a663c91bb7f (patch) | |
| tree | c700d0c817b2e197bc109683ecef7a2a7a2bfc6d /library/std/src/primitive_docs.rs | |
| parent | 9cf2516251c5379d3e8429342e8a392df81b9aaa (diff) | |
| download | rust-d986924eb13a103fc79c474eded47a663c91bb7f.tar.gz rust-d986924eb13a103fc79c474eded47a663c91bb7f.zip | |
doc: apply suggestions
Diffstat (limited to 'library/std/src/primitive_docs.rs')
| -rw-r--r-- | library/std/src/primitive_docs.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/library/std/src/primitive_docs.rs b/library/std/src/primitive_docs.rs index b22adbbe3d3..7aca5451ebc 100644 --- a/library/std/src/primitive_docs.rs +++ b/library/std/src/primitive_docs.rs @@ -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: /// |
