Skip to content
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

Remove redundant Ord method impls. #8357

Closed
wants to merge 1 commit into from
Closed

Remove redundant Ord method impls. #8357

wants to merge 1 commit into from

Conversation

omasanori
Copy link
Contributor

I feel it's time to eliminate them (and add some testcases.)

@bluss
Copy link
Member

bluss commented Aug 6, 2013

The default methods for Ord aren't marked inline (I added them, so sorry!). We should mark them inline, but does it even take effect?

@thestinger
Copy link
Contributor

@blake2-ppc: yeah, I think it works - this is going to be a performance regression at the moment

@omasanori
Copy link
Contributor Author

Yes, the only concern in this patch is whether I should add #[inline] to the default methods.
Thank you for your clarification, @blake2-ppc and @thestinger!

@omasanori
Copy link
Contributor Author

OK, I'll fix them. Thank you.

@thestinger
Copy link
Contributor

I opened #8360 about the existing issues with container Ord implementations.

@omasanori
Copy link
Contributor Author

@thestinger Great. Should I leave containers as it was until #8360 get a consensus?

@thestinger
Copy link
Contributor

Well it doesn't really need a consensus - it's wrong and should be fixed. It's just not entirely clear to me how to fix it.

You don't have to fix it as part of this PR though, we just shouldn't break more.

@omasanori
Copy link
Contributor Author

@thestinger Sure.

Basically, generic containers should not use the default methods since a
type of elements may not guarantees total order. str could use them
since u8's Ord guarantees total order. Floating point numbers are also
broken with the default methods because of NaN. Thanks for @thestinger.

Timespec also guarantees total order AIUI. I'm unsure whether
extra::semver::Identifier does so I left it alone. Proof needed.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
@omasanori
Copy link
Contributor Author

Rebased to current master. r?

bors added a commit that referenced this pull request Aug 9, 2013
I feel it's time to eliminate them (and add some testcases.)
@bors bors closed this Aug 9, 2013
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