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).
Spawned off of #24270, in particular this discussion: #24270 (diff)
The new code for
deriving(PartialOrd)attempts to look up if there is areprattribute on theenumthat 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 au64today).However, the look up may be fragile, since @sfackler points out that a later pass of expansion could add the
reprthat we are seeking.There are a number of different ways to solve this problem (see the linked discussion for some of them).