-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Derive std::cmp::Reverse as Copy or Clone #47379
Conversation
If the type parameter is Copy or Clone, then `Reverse` should be too.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @BurntSushi (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Shouldn't we add Hash and Default for this? |
@Mark-Simulacrum can you expand on what you mean by "for this"? Do you mean "since we are adding the |
Yes, that's what I meant. Sorry for not being clear. |
Interesting. If there is any unwritten 'gold standard' for wrapper type deriving in libcore, then perhaps it is apparent by looking at #[derive(Clone, Copy, PartialEq, Eq, Debug, Hash)] // PartialOrd and Ord specialized here What do you think? EDIT: PartialOrd and Ord are specialized here. |
Option also implements Default, which we should derive as well; Option needs to implement it as an enum but this struct can derive it. |
Actually, iterators shouldn't implement |
@shepmaster I wish we had a canonical thing to point to - but it's basically blocked on a lint. |
|
Review ping for you @BurntSushi! |
Haha, I was thinking |
It seems like we probably want a @rfcbot fcp merge |
@BurntSushi I guess rfcbot doesn't recognize edits. |
@rfcbot fcp merge |
Team member @BurntSushi has proposed to merge this. The next step is review by the rest of the tagged teams: 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. |
Ping for ticky boxes, @Kimundi ! |
@Kimundi there is a nice checkbox in #47379 (comment) waiting for you! |
Hey @Kimundi can you please respond? |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
1 similar comment
🔔 This is now entering its final comment period, as per the review above. 🔔 |
Sorry! I'm really bad at staying on top of my github notifications, and I thought I had already checked this one at the last ping... |
@bors r+ |
📌 Commit 96157ef has been approved by |
@bors rollup |
Derive std::cmp::Reverse as Copy or Clone If the type parameter is Copy or Clone, then `Reverse` should be too.
If the type parameter is Copy or Clone, then
Reverse
should be too.