Skip to content

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

Merged
merged 1 commit into from
Sep 7, 2015

Conversation

Manishearth
Copy link
Member

/// 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.
Copy link
Member

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

@steveklabnik
Copy link
Member

r=me after nit

@Manishearth
Copy link
Member Author

@bors r=steveklabnik rollup

agh, was going to write "independent integers" and forgot to change it properly

@bors
Copy link
Collaborator

bors commented Sep 6, 2015

📌 Commit 3a87d1d has been approved by steveklabnik

///
/// 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rc::new(1); 5

@Manishearth
Copy link
Member Author

@bors r=steveklabnik rollup

@bors
Copy link
Collaborator

bors commented Sep 6, 2015

📌 Commit f669be8 has been approved by steveklabnik

///
/// 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still wrong :(

@Gankra
Copy link
Contributor

Gankra commented Sep 6, 2015

@bors r-

@Manishearth
Copy link
Member Author

@bors r=steveklabnik rollup

agh, fixed

@bors
Copy link
Collaborator

bors commented Sep 6, 2015

📌 Commit 5e2d854 has been approved by steveklabnik

@bors
Copy link
Collaborator

bors commented Sep 7, 2015

⌛ Testing commit 5e2d854 with merge 6f14240...

@bors bors merged commit 5e2d854 into rust-lang:master Sep 7, 2015
@Manishearth Manishearth deleted the improve_vec_docs branch December 2, 2016 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants