Skip to content

Specify spec of PartialEq and PartialOrd on trait method side for now#82

Merged
coord-e merged 1 commit intomainfrom
coord-e/partialeq-partialord-spec
May 10, 2026
Merged

Specify spec of PartialEq and PartialOrd on trait method side for now#82
coord-e merged 1 commit intomainfrom
coord-e/partialeq-partialord-spec

Conversation

@coord-e
Copy link
Copy Markdown
Owner

@coord-e coord-e commented May 10, 2026

Sometimes rustc generates PartialEq and PartialOrd method calls like <&i32 as PartialEq>::eq. Since Thrust doesn't know how to type the DefId of impl<T> PartialEq for &T, it causes an "unknown def" panic. We should be able to handle these kinds of blanket impls, but it'll take some effort; we need to refer to the spec of <T as PartialEq>::eq within the spec of <&T as PartialEq>::eq, which isn't possible with the current annotation implementation.

For now, this PR defines a simple PartialEq and PartialOrd specs applied for all implementors (as of #79) and leaves precise specs for blanket impls as future work.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds temporary, generic extern specs for PartialEq::eq and PartialOrd::{lt,gt} on the trait method side to avoid Thrust panicking on rustc-generated UFCS calls (e.g. <&i32 as PartialEq>::eq) that currently hit “unknown def” for blanket impls on references.

Changes:

  • Add a generic extern spec for PartialEq::eq.
  • Add generic extern specs for PartialOrd::lt and PartialOrd::gt.
  • Document (via TODO) that these specs are intentionally imprecise pending better per-impl / blanket-impl support.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread std.rs Outdated
Comment thread std.rs Outdated
Comment thread std.rs Outdated
Comment thread std.rs
@coord-e coord-e force-pushed the coord-e/partialeq-partialord-spec branch from 42bb61a to d0674c8 Compare May 10, 2026 07:16
@coord-e coord-e merged commit 798cd3b into main May 10, 2026
6 checks passed
@coord-e coord-e deleted the coord-e/partialeq-partialord-spec branch May 10, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants