about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper
diff options
context:
space:
mode:
authorJubilee <workingjubilee@gmail.com>2024-10-01 23:15:59 -0700
committerGitHub <noreply@github.com>2024-10-01 23:15:59 -0700
commitea453bb10b58853dac30b57ceea66cedf61965f8 (patch)
tree5fc0aa53f6c3a5ac90a4d518009cb59cbef88d17 /compiler/rustc_llvm/llvm-wrapper
parent1d71891c6b6dc0f8c27493e6e6026b6ba44664e0 (diff)
parentc4ce8c114b06840c3521a189ee44958b713fb33a (diff)
downloadrust-ea453bb10b58853dac30b57ceea66cedf61965f8.tar.gz
rust-ea453bb10b58853dac30b57ceea66cedf61965f8.zip
Rollup merge of #130885 - RalfJung:interp-error-discard, r=oli-obk
panic when an interpreter error gets unintentionally discarded

One important invariant of Miri is that when an interpreter error is raised (*in particular* a UB error), those must not be discarded: it's not okay to just check `foo().is_err()` and then continue executing.

This seems to catch new contributors by surprise fairly regularly, so this PR tries to make it so that *if* this ever happens, we get a panic rather than a silent missed UB bug. The interpreter error type now contains a "guard" that panics on drop, and that is explicitly passed to `mem::forget` when an error is deliberately discarded.

Fixes https://github.com/rust-lang/miri/issues/3855
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper')
0 files changed, 0 insertions, 0 deletions