Skip to content

Add RevOrd type #10860

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
Closed

Add RevOrd type #10860

wants to merge 1 commit into from

Conversation

octurion
Copy link

@octurion octurion commented Dec 8, 2013

Add a RevOrd type in std::cmp, which reverses the natural order of types.

Such a type could be useful for implementing, for example, a max heap, assuming a min heap implementation already exists.

@thestinger
Copy link
Contributor

There are a limitless number of orderings you could want and we're not going to cover them all with traits. I think a newtype is the right choice in these cases, and we need a more powerful deriving for newtypes working on any trait.

@bill-myers
Copy link
Contributor

@thestinger Hmm, isn't the newtype you are asking for exactly what this pull request implements?

@thestinger
Copy link
Contributor

@bill-myers: My comment had messed up wording.

@pcwalton
Copy link
Contributor

This is fine by me. Will bring up at the meeting.

@pcwalton
Copy link
Contributor

Consensus at the meeting was YAGNI.

@pcwalton pcwalton closed this Dec 10, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jun 30, 2023
add checking for cfg(features = ...)

*Please write a short comment explaining your change (or "none" for internal only changes)*

changelog: [`maybe_misused_cfg`]: check if `#[cfg(feature = "...")]` misused as `#[cfg(features = "...")]`

I've found that there is no indication when `#[cfg(features = "...")]` is used incorrectly, which can easily make mistakes hard to spot. When I searched for this code on github, I also found many misuse cases([link](https://github.com/search?q=%23%5Bcfg%28features+language%3ARust&type=code)).

PS: This clippy name is just a temporary name, it can be replaced with a better name.
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