You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cloned type wouldn't have the guarantees that Copied does, as it calls the clone method, which can have side-effects (it shouldn't, but it's not something we can depend on).
Although I suppose we currently DO expose specialization in Cloned structure when Clone implementation is incompatible with Copy implementation. This seems like a bug, so I will fix that in a separate PR.
Once a majority of reviewers approve (and none object), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!
See this document for info about what commands tagged team members can give me.
Activity
pmarcelll commentedon Dec 26, 2018
sugar700 commentedon Dec 26, 2018
alercah commentedon Jan 20, 2019
The
map_clonelint in Clippy should be updated to suggest this instead when the type is copiable.Centril commentedon Jan 28, 2019
So we added a newtype
Copiedbecause that's what we usually do. However, in this case, we could simply reuseClonedand implement copied as:Are there notable reasons not to do this that I'm missing? Doing so would substantially decrease the cost of this feature for the standard library.
sugar700 commentedon Jan 29, 2019
Clonedtype wouldn't have the guarantees thatCopieddoes, as it calls theclonemethod, which can have side-effects (it shouldn't, but it's not something we can depend on).Although I suppose we currently DO expose specialization in
Clonedstructure whenCloneimplementation is incompatible withCopyimplementation. This seems like a bug, so I will fix that in a separate PR.sugar700 commentedon Jan 29, 2019
See #57970.
SimonSapin commentedon Feb 1, 2019
The comment about the
Copiedtype belongs in #57127. Since I see no objection toOption::copied:@rfcbot fcp merge
rfcbot commentedon Feb 1, 2019
Team member @SimonSapin has proposed to merge this. The next step is review by the rest of the tagged team members:
No concerns currently listed.
Once a majority of reviewers approve (and none object), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!
See this document for info about what commands tagged team members can give me.
rfcbot commentedon Feb 8, 2019
🔔 This is now entering its final comment period, as per the review above. 🔔
rfcbot commentedon Feb 18, 2019
The final comment period, with a disposition to merge, as per the review above, is now complete.
matklad commentedon Mar 15, 2019
Am I correct that this now awaits for a stabilization PR?
SimonSapin commentedon Mar 15, 2019
Yes.
Stabilize Option::copied
matklad commentedon Mar 16, 2019
Stabilization PR is up: #59231
Rollup merge of rust-lang#59231 - matklad:copied, r=Centril