THURSDAY, SEPTEMBER 3, 2026
gccrs
gccrs: Remove erroneous unify logic affecting `PartialEq` in core
gccrs removes a problematic unify hack that broke `PartialEq` for core types.
A temporary hack related to unification in the operator overload handling within gccrs has been identified as problematic. This hack incorrectly affected the PartialEq implementation for core Rust types. This commit removes the erroneous code from rust-hir-type-check-expr.cc.
In Details
An 'old hack' in typecheck/rust-hir-type-check-expr.cc related to unification during operator overload resolution was found to incorrectly break the PartialEq trait implementation for fundamental Rust types. This commit removes that hack, restoring correct behavior for equality checks.
For Context
- gccrs
- The GCC frontend for the Rust programming language. It translates Rust code into GCC's internal representation (GIMPLE) for optimization and code generation.
- Unify
- In type systems, unification is the process of finding a most general substitution that makes two type expressions equal. It's a core operation in type inference and checking.
- Operator Overload
- A feature in some programming languages that allows operators (like +, ==) to be defined for custom types. In Rust, this is typically achieved through traits like
AddorPartialEq. - PartialEq
- A standard Rust trait that provides the
==and!=operators for equality comparison. Types implementingPartialEqcan be compared for equality.