We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 86156ac + 5e2d854 commit 6f14240Copy full SHA for 6f14240
src/libcollections/macros.rs
@@ -32,6 +32,12 @@
32
/// Note that unlike array expressions this syntax supports all elements
33
/// which implement `Clone` and the number of elements doesn't have to be
34
/// a constant.
35
+///
36
+/// This will use `clone()` to duplicate an expression, so one should be careful
37
+/// using this with types having a nonstandard `Clone` implementation. For
38
+/// example, `vec![Rc::new(1); 5]` will create a vector of five references
39
+/// to the same boxed integer value, not five references pointing to independently
40
+/// boxed integers.
41
#[cfg(not(test))]
42
#[macro_export]
43
#[stable(feature = "rust1", since = "1.0.0")]
0 commit comments