Skip to content

Remove repr-lookup attempt in derive expansion #24320

Closed
@pnkfelix

Description

@pnkfelix

Spawned off of #24270, in particular this discussion: #24270 (diff)

The new code for deriving(PartialOrd) attempts to look up if there is a repr attribute on the enum that is driving the deriving expansion, because we need (at least) to incorporate knowledge of whether the discriminant is meant to be interpreted as a signed integer or an unsigned one (since the current intrinsic always returns a u64 today).

However, the look up may be fragile, since @sfackler points out that a later pass of expansion could add the repr that we are seeking.

There are a number of different ways to solve this problem (see the linked discussion for some of them).

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.P-lowLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions