954873055a
add 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 |
||
---|---|---|
.. | ||
codegen | ||
codegen-units | ||
compile-fail | ||
compile-fail-fulldeps | ||
debuginfo | ||
incremental | ||
mir-opt | ||
parse-fail | ||
pretty | ||
run-fail | ||
run-fail-fulldeps | ||
run-make | ||
run-pass | ||
run-pass-fulldeps | ||
run-pass-valgrind | ||
rustdoc | ||
ui |