rust/compiler/rustc_middle
Jubilee ea453bb10b
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
2024-10-01 23:15:59 -07:00
..
src Rollup merge of #130885 - RalfJung:interp-error-discard, r=oli-obk 2024-10-01 23:15:59 -07:00
Cargo.toml disable size asserts in the compiler when randomizing layouts 2024-08-31 23:56:45 +02:00
messages.ftl TL note: current means target 2024-09-20 10:02:14 -07:00
README.md

For more information about how rustc works, see the rustc dev guide.