-
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
Regression in done-0.0.0-reserve on Rust 1.17 #40192
Comments
This has to do with a broken implementation of On Rust 1.16.0 the standard I'm not really sure how to classify this, but we'll likely want to talk about this during libs triage. @rust-lang/libs, thoughts here? I'm not sure if there's practical implications to changing to use |
Buggy code is buggy, IMO. |
I don't believe there are correctness concerns re float arrays since |
Interesting. Now we have to decide who is to blame here :) In this implementation So is the specialization to blame then? Well, the specialization rule certainly isn't incorrect. It's merely an optimization that avoids going through several Oh well. Looks like we have to shift the blame onto the user. That said, I'm feeling very sympathetic. The user wrote what they thought was sensible code and it didn't work in very subtle ways. I believe this is what happened... They wanted to have a custom implementation of Unfortunately, implementing Another possible scenario is that the user already had |
Why doesn't that compile? That's the pattern I use. |
@sfackler You're right. Sorry, I've fixed my comment now. But anyways... the point is, it's easier to do the wrong thing by writing |
@sfackler oh yes that's right (Ord not on floats), so I think the problem here is what we should do in the face of disagreeing Ord/PartialOrd implementations. I'm tempted to say "yes, code can be buggy" in the sense that "libstd can assume that PartialOrd is the same as Ord if both are implemented". |
There's a clippy lint for the same issue but for |
Do we have a consensus on this? Suppose that the user derives
Should I believe By this reasoning, I wouldn't classify this issue as a regression, but would like to see rustc emit a warning in cases like this one. |
Ok we got a chance to discuss this during triage today and the conclusion was that we're going to close this issue. We think it's fair to say that |
Note that exploring something like a lint in clippy would be great to help catch this! |
The source is hard to acquire so here's an equivalent test case:
Not on 1.16.
The text was updated successfully, but these errors were encountered: