Uh oh!
There was an error while loading. Please reload this page.
Derive ToPrimitive for enums - #314
Conversation
PlasmaPower
commented
Jul 8, 2017
Failure unrelated to this PR, it's instead due to rust-lang/rust#42431 |
cuviper
commented
Jul 8, 2017
That failure is also #312. Simple enums can be cast directly to integers with |
PlasmaPower
commented
Jul 8, 2017
@cuviper Oh I had no idea! I'll change the implementation. |
PlasmaPower
commented
Jul 8, 2017
|
cuviper
commented
Jul 8, 2017
via email
Hmm, that's awkward. Such enums should be trivially copyable. |
Should be, but we can't guarantee they implement Yeah, it's awkward. |
cuviper
commented
Jul 11, 2017
I don't think it's quite that hygienic -- at least from a quick test, deriving with bors r+ |
PlasmaPower
commented
Jul 11, 2017
@cuviper I didn't check that, but trying to use the |
Build succeeded |
cuviper
commented
Jul 11, 2017
That's ok. What you wrote works, most importantly. Thanks! |
I had to double the compile fail tests, as they will bail on the first error.
I have some ideas for more complex to/from primitive derives (with inner values that implement to/from primitive), but I'll save those for a future PR.