diff options
| author | bors <bors@rust-lang.org> | 2015-09-07 03:09:05 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-09-07 03:09:05 +0000 |
| commit | 6f142404d6f9e0b2ea87c4f58806bf763eb42d83 (patch) | |
| tree | 8272350359852f9fa627ce56081c181bdcd477ca | |
| parent | 86156ac60607c760dda349c88bbdc08898cf7494 (diff) | |
| parent | 5e2d8545e8f470a9b25f54e84d93e808e17d73e4 (diff) | |
| download | rust-6f142404d6f9e0b2ea87c4f58806bf763eb42d83.tar.gz rust-6f142404d6f9e0b2ea87c4f58806bf763eb42d83.zip | |
Auto merge of #28272 - Manishearth:improve_vec_docs, r=steveklabnik
r? @steveklabnik
| -rw-r--r-- | src/libcollections/macros.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libcollections/macros.rs b/src/libcollections/macros.rs index 5f614f3649c..6a683e65c9e 100644 --- a/src/libcollections/macros.rs +++ b/src/libcollections/macros.rs @@ -32,6 +32,12 @@ /// Note that unlike array expressions this syntax supports all elements /// which implement `Clone` and the number of elements doesn't have to be /// a constant. +/// +/// This will use `clone()` to duplicate an expression, so one should be careful +/// using this with types having a nonstandard `Clone` implementation. For +/// example, `vec![Rc::new(1); 5]` will create a vector of five references +/// to the same boxed integer value, not five references pointing to independently +/// boxed integers. #[cfg(not(test))] #[macro_export] #[stable(feature = "rust1", since = "1.0.0")] |
