about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-09-30 07:35:04 -0700
committerGitHub <noreply@github.com>2016-09-30 07:35:04 -0700
commit954873055a998a06841ac19b39b1fe18a6641731 (patch)
tree7b78cb8140c79594ac582e7c1421ac132a5d2ace /src/rustllvm/RustWrapper.cpp
parent1d64acdceb6f0eebbc5e8774972b86e4cf192a0f (diff)
parenta84b55085e314b243fd536c4e6804a58dfce122a (diff)
downloadrust-954873055a998a06841ac19b39b1fe18a6641731.tar.gz
rust-954873055a998a06841ac19b39b1fe18a6641731.zip
Auto merge of #36823 - durka:discriminant_value, r=nagisa
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
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions