-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Mir undefined behaviour false positive when comparing Option<&T> #55454
Comments
Reduced repro: #[derive(PartialEq)]
struct This<T>(T);
fn main() {
This(Some(&1)) == This(Some(&1));
} |
|
I cannot reproduce this on the playground |
Playground has an "ancient" nightly (2018-10-25). |
@memoryruins can you also test 2018-10-26? So far, we got this commit range: 4bd4e41...cae6efc. @oli-obk's CTFE query PR landed there. |
|
@memoryruins thanks! Regression range is 4bd4e41...3e6f30e then. |
I have confirmed the issue to been exposed by the CTFE query PR. We didn't use to validate promoteds. My PR only exposed the preexisting issue: struct This<T>(T);
const C: This<Option<&i32>> = This(Some(&1)); Fails on nightly even before my PR. |
Oh cool! cargo-bisect can pinpoint a regressing PR. Unable to try it out today, but definitely bookmarking :) edit: wonder how it would handle this after seeing oli’s comment. |
easy: bisect my example with the constant instead of the original one I have a very good idea which change is at fault though: https://github.com/rust-lang/rust/pull/54762/files#diff-269a7510489262b796ff39a89b2dbdc2R283 was introduced replacing https://github.com/rust-lang/rust/pull/54762/files#diff-269a7510489262b796ff39a89b2dbdc2L142 fix-PR incoming |
…Jung Fix validation false positive Fixes rust-lang#55454 r? @RalfJung
I discovered this bug while tinkering with the frunk crate.
This code compiles and runs on stable.
But fails on nightly
The text was updated successfully, but these errors were encountered: