durka
changed the title
add stable wrapper for discriminant_value intrinsic
add soon-to-be-stable wrapper for discriminant_value intrinsic
Marks issues that should be documented in the release notes of the next release.
label
Jul 12, 2016
durka
mentioned this pull request
Merged
durka
changed the title
[WIP] add wrapper for discriminant_value intrinsic
[RFC accepted] add wrapper for discriminant_value intrinsic
Closed
durka
mentioned this pull request
Merged
bors added a commit that referenced this pull request
Sep 30, 2016add wrapper for discriminant_value, take 2 [This is #34785 reopened, since @bors apparently gave up on that thread.] add wrapper for discriminant_value intrinsic Implementation of [RFC 1696](https://github.com/rust-lang/rfcs/blob/master/text/1696-discriminant.md). Wraps the `discriminant_value` intrinsic under the name `std::mem::discriminant`. In order to avoid prematurely leaking information about the implementation of enums, the return value is an opaque type, generic over the enum type, which implements Copy, Clone, PartialEq, Eq, Hash, and Debug (notably not PartialOrd). There is currently no way to get the value out excepting printing the debug representation. The wrapper is safe and can be stabilized soon as per discussion in #24263. cc @aturon r? @nagisa