Open
Description
The field is part of the PartialEq
impl, and thus two constants that are equal except in their span will compare inequal. This causes problems in #77551 (comment) and #77549 (comment) and possibly in other places.
The "trivial" way to resolve this is to manually implement PartialEq
and make it skip the Span
field.
Downside: now we may cause weird diagnostics after such an optimization has been applied, because if one of the constants is eliminated, all diagnostics are reported on the other diagnostic's site. We'd need a multispan and properly combine it. That will be hard to ensure to happen if we just silently change PartialEq
cc @rust-lang/wg-mir-opt
Metadata
Metadata
Assignees
Labels
Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlArea: Messages for errors, warnings, and lintsArea: MIR optimizationsCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Relevant to the compiler team, which will review and decide on the PR/issue.