diff options
| author | William Woodruff <william@trailofbits.com> | 2020-12-10 17:47:28 -0500 |
|---|---|---|
| committer | William Woodruff <william@trailofbits.com> | 2020-12-10 17:47:28 -0500 |
| commit | 9cf2516251c5379d3e8429342e8a392df81b9aaa (patch) | |
| tree | c8cbb1c0e24fbaf766e25621594e7919103003f6 /library/alloc/src | |
| parent | d32c320d7eee56706486fef6be778495303afe9e (diff) | |
| download | rust-9cf2516251c5379d3e8429342e8a392df81b9aaa.tar.gz rust-9cf2516251c5379d3e8429342e8a392df81b9aaa.zip | |
doc(array,vec): add notes about side effects when empty-initializing
Diffstat (limited to 'library/alloc/src')
| -rw-r--r-- | library/alloc/src/macros.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/library/alloc/src/macros.rs b/library/alloc/src/macros.rs index a992d768d63..bbff1d3dc4d 100644 --- a/library/alloc/src/macros.rs +++ b/library/alloc/src/macros.rs @@ -29,6 +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. +/// /// [`Vec`]: crate::vec::Vec #[cfg(not(test))] #[macro_export] |
