-
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
Weird f32 PartialEq behavior on 1.64 -> 1.65 #115071
Comments
Yeah, the code you provided should have never passed in the first place. Looks like the derived // 1.64:
impl ::core::cmp::Eq for WithBool {
fn assert_receiver_is_total_eq(&self) -> () {
let _: ::core::cmp::AssertParamIsEq<Option<bool>>;
}
}
// 1.65
impl ::core::cmp::Eq for WithBool {
fn assert_receiver_is_total_eq(&self) -> () {
let _: ::core::cmp::AssertParamIsEq<Option<bool>>;
let _: ::core::cmp::AssertParamIsEq<Option<f32>>;
}
} |
So this actually regressed from fail -> pass in 1.64: #98758 Then was fixed in 1.65 in #103176 I'm gonna close this PR because it's clear where the regression occurred and then was fixed according to those PRs above. Thanks for the bug report, and sorry that rustc mistakenly accepted your buggy code. Hope it's not too hard to fix 😅 ❤️ |
Ez to fix! Thanks for showing me the paper trail and quick response! Cool to see the context! |
I am trying to upgrade my company's toolchain from 1.64 to 1.71. I noticed that we had some odd code that was compiling before and is no longer compiling. I got it down to a change between 1.64 and 1.65, and my first thought is that this might be affected by this PR: #98655
Notably that PR mentions that...
But I would imagine neither bool nor f32 would have an inconsistent PartialEq? I apologize if this is something that already is covered by that statement and I'm misunderstanding.
It does seem like my code is already buggy, but wanted to file this anyways in case someone else comes across it.
So this compiles on 1.64, and doesn't on 1.65.
Notably, none of the following compiles on 1.64.
Code
I tried this code:
I expected to see this happen: It would compile on both or not compile on both.
Instead, this happened: It only compiles on 1.64 (which surprised me given I didn't think f32 impl'd Eq).
Version it worked on
This compiled on Rust 1.64, but did not compile on Rust 1.65.
It most recently worked on: Rust 1.64
Version with regression
rustc --version --verbose
:Backtrace
The compiler did not crash.
Backtrace
The text was updated successfully, but these errors were encountered: