]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Fix issues around PartialEq Eq Ord Partial Ord
authorPhilip Herron <herron.philip@googlemail.com>
Tue, 17 Jun 2025 10:32:21 +0000 (11:32 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 5 Aug 2025 14:36:49 +0000 (16:36 +0200)
commit1223585918cf691ebd0214f4c5134cbf355c54bc
tree9918733360f51426ad845ffab0063d77a6f33c5a
parenta0ada5fb1bbd7c005086b267a5e8ae5de12aed5a
gccrs: Fix issues around PartialEq Eq Ord Partial Ord

There is still an issue with derive on PartialOrd but this adds good tests
and fixes a bug we had handling the default Rhs = Self generic type param
substitutions on the comparison traits.

gcc/rust/ChangeLog:

* typecheck/rust-tyty.cc (ParamType::handle_substitions): make this consistent

gcc/testsuite/ChangeLog:

* rust/compile/bug-with-default-generic.rs: New test.
* rust/execute/torture/partial-eq-1.rs: New test.
* rust/execute/torture/partial-eq-2.rs: New test.
* rust/execute/torture/partial-eq-3.rs: New test.
* rust/execute/torture/partial-eq-4.rs: New test.
* rust/execute/torture/partial-ord-1.rs: New test.
* rust/execute/torture/partial-ord-2.rs: New test.
* rust/execute/torture/partial-ord-3.rs: New test.
* rust/execute/torture/partial-ord-4.rs: New test.
* rust/execute/torture/partial-ord-5.rs: New test.

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
gcc/rust/typecheck/rust-tyty.cc
gcc/testsuite/rust/compile/bug-with-default-generic.rs [new file with mode: 0644]
gcc/testsuite/rust/execute/torture/partial-eq-1.rs [new file with mode: 0644]
gcc/testsuite/rust/execute/torture/partial-eq-2.rs [new file with mode: 0644]
gcc/testsuite/rust/execute/torture/partial-eq-3.rs [new file with mode: 0644]
gcc/testsuite/rust/execute/torture/partial-eq-4.rs [new file with mode: 0644]
gcc/testsuite/rust/execute/torture/partial-ord-1.rs [new file with mode: 0644]
gcc/testsuite/rust/execute/torture/partial-ord-2.rs [new file with mode: 0644]
gcc/testsuite/rust/execute/torture/partial-ord-3.rs [new file with mode: 0644]
gcc/testsuite/rust/execute/torture/partial-ord-4.rs [new file with mode: 0644]
gcc/testsuite/rust/execute/torture/partial-ord-5.rs [new file with mode: 0644]