about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2021-08-22 20:52:51 +0200
committerGitHub <noreply@github.com>2021-08-22 20:52:51 +0200
commit3b1e7b1fc9853497140f7f5371882234f0295893 (patch)
treeac00ffb1283c9807767e2dd2ebac82f4bd6b64eb /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
parent2627db6a3cc4115cc3ff7a1597eb44347acb0c54 (diff)
parent4c0ff4db80d2c6cb4dc204f65f34ce2246e27bfe (diff)
downloadrust-3b1e7b1fc9853497140f7f5371882234f0295893.tar.gz
rust-3b1e7b1fc9853497140f7f5371882234f0295893.zip
Rollup merge of #87166 - de-vri-es:show-discriminant-before-overflow, r=jackh726
Show discriminant before overflow in diagnostic for duplicate values.

This PR adds the value before overflow for explicit discriminant values in the error for duplicate discriminant values.
I found it rather confusing to see only the overflowed value.

It only does this for literals, since overflows in const evaluated arithmetic are already a hard error.

This is my first PR to the compiler, so please let me know if the implementation can be improved :)

Before:
![image](https://user-images.githubusercontent.com/786213/125850097-bf5fb7e0-d800-4386-a738-c30f41822964.png)

After:
![image](https://user-images.githubusercontent.com/786213/125850120-e2bb765d-ad86-4888-a6cb-dec34fba3fea.png)
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions