about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorTomasz Miąsko <tomasz.miasko@gmail.com>2021-10-11 00:00:00 +0000
committerTomasz Miąsko <tomasz.miasko@gmail.com>2021-11-20 10:31:17 +0100
commitc3e71d83cdeb0ccaf6584255313380fd166b1096 (patch)
treebf300228dff91ce2ec224e4af4fd0df90cefb35b /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parentd5a91f3114dde5a32dc69f9114fca0d9b0fd2abc (diff)
downloadrust-c3e71d83cdeb0ccaf6584255313380fd166b1096.tar.gz
rust-c3e71d83cdeb0ccaf6584255313380fd166b1096.zip
Fix a variant index and variant discriminant confusion
Previously for enums using the `Variants::Single` layout, the variant
index was being confused with its discriminant. For example, in the case
of `enum E { A = 1 }`.

Use `discriminant_for_variant` to avoid the issue.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions