Skip to content

RFC: Add Copy and DeepCopy trait and deriving modes #9375

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

Closed
wants to merge 1 commit into from

Conversation

Kimundi
Copy link
Member

@Kimundi Kimundi commented Sep 21, 2013

This prepares the source code for renaming clone -> copy.
Needs an snapshot to proceed.

I'm not sure if it's actually desirable at this point to make the change, but I think copy is a more fitting name than clone.

  • clone might confuse people coming from, eg, java.
    • clone there is per default implemented as reference copy, and can be overriden for custom clone behavior.
    • The semantic of our Clone and DeepClone are more clear cut: Clone copies as shallow as possible, DeepClone as deep as possible.
  • Our clone is also frequently just a fast, low level copy, the name clone might imply something more heavy going on per default.
  • It's shorter, always good for a frequently called function.

@emberian
Copy link
Member

This is exactly the thing that a "super-review" would be nice for. This should be discussed at a meeting before getting merged, I think.

@brson
Copy link
Contributor

brson commented Sep 21, 2013

Please hold off on this for further discussion.

@brson
Copy link
Contributor

brson commented Sep 21, 2013

I put it on the meeting agenda.

@Kimundi
Copy link
Member Author

Kimundi commented Sep 21, 2013

@cmr oh, definitively. ;)
@brson Sorry, my intention was not to just let that slip in. I realize that this is a major change.

@brson
Copy link
Contributor

brson commented Sep 24, 2013

Consensus is to leave it as Clone, primarily to avoid the disruptive change.

@brson brson closed this Sep 24, 2013
@Kimundi
Copy link
Member Author

Kimundi commented Sep 24, 2013

Hm, sad to hear this, especially because "disruptive change" seems more like an argument for doing it as early as possible, or at least wait to the point when we have an refactoring tool that can do this fast.

Basing an decision that will affect the final language on only the annoyance of implementing it seems wrong to me...

The meeting notes argument that clone implies that more stuff is going on there than a simple memcpy I buy, though.

djkoloski pushed a commit to djkoloski/rust that referenced this pull request Sep 21, 2022
Use macro callsite when creating `Sugg` helper

Closes rust-lang#9375

changelog: Improvement: [`collapsible_if`]: Suggestions now work with macros, by taking the call site into account.
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.

3 participants