1
Fork 0

Auto merge of #86194 - RalfJung:const-ub-hard-error, r=oli-obk

make UB during CTFE a hard error

This is a next step for https://github.com/rust-lang/rust/issues/71800. `const_err` has been a future-incompatibility lint for 4 months now since https://github.com/rust-lang/rust/pull/80394 (and err-by-default for many years before that), so I think we could try making it a proper hard error at least in some situations.

I didn't yet adjust the tests, since I first want to gauge the fall-out via crater.
Cc `@rust-lang/wg-const-eval`
This commit is contained in:
bors 2021-06-18 23:17:40 +00:00
commit ec57c60c50
25 changed files with 342 additions and 865 deletions

View file

@ -525,6 +525,7 @@ impl InterpError<'_> {
use InterpError::*;
match *self {
MachineStop(ref err) => err.is_hard_err(),
InterpError::UndefinedBehavior(_) => true,
_ => false,
}
}