Skip to content

gccrs: Fix issues around PartialEq Eq Ord Partial Ord#3832

Merged
philberty merged 1 commit into
masterfrom
phil/derive-dev
Jun 18, 2025
Merged

gccrs: Fix issues around PartialEq Eq Ord Partial Ord#3832
philberty merged 1 commit into
masterfrom
phil/derive-dev

Conversation

@philberty

Copy link
Copy Markdown
Member

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.

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>
@philberty philberty added this pull request to the merge queue Jun 18, 2025
@philberty philberty added the HIR label Jun 18, 2025
Merged via the queue into master with commit d7e2310 Jun 18, 2025
12 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in libcore 1.49 Jun 18, 2025
@philberty philberty deleted the phil/derive-dev branch June 21, 2025 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant