-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Add note about clone in docs for vec![] #28272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
/// 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 independent | ||
/// boxed integer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be
pointing to independently boxed integers
r=me after nit |
cc2b9a8
to
3a87d1d
Compare
@bors r=steveklabnik rollup agh, was going to write "independent integers" and forgot to change it properly |
📌 Commit 3a87d1d has been approved by |
/// | ||
/// 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rc::new(1); 5
3a87d1d
to
f669be8
Compare
@bors r=steveklabnik rollup |
📌 Commit f669be8 has been approved by |
/// | ||
/// 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still wrong :(
@bors r- |
f669be8
to
5e2d854
Compare
@bors r=steveklabnik rollup agh, fixed |
📌 Commit 5e2d854 has been approved by |
r? @steveklabnik