diff options
| author | Ralf Jung <post@ralfj.de> | 2020-03-10 09:22:16 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2020-03-22 22:47:35 +0100 |
| commit | 2ee2157e29b9cab1fc0ebd89246ba27f48fce3d9 (patch) | |
| tree | c12e41397a96cf0127016b818ed661f8904b2a32 /src/librustc_mir/interpret/validity.rs | |
| parent | 1902d1e0de179498d0cb7fd4856d1e0ffcd52095 (diff) | |
| download | rust-2ee2157e29b9cab1fc0ebd89246ba27f48fce3d9.tar.gz rust-2ee2157e29b9cab1fc0ebd89246ba27f48fce3d9.zip | |
miri engine: turn error sanity checks into assertions
Diffstat (limited to 'src/librustc_mir/interpret/validity.rs')
| -rw-r--r-- | src/librustc_mir/interpret/validity.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/librustc_mir/interpret/validity.rs b/src/librustc_mir/interpret/validity.rs index d93b78a5bd5..6f9543bf95a 100644 --- a/src/librustc_mir/interpret/validity.rs +++ b/src/librustc_mir/interpret/validity.rs @@ -825,11 +825,10 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { // Run it. match visitor.visit_value(op) { Ok(()) => Ok(()), + // We should only get validation errors here. Avoid other errors as + // those do not show *where* in the value the issue lies. Err(err) if matches!(err.kind, err_ub!(ValidationFailure { .. })) => Err(err), - Err(err) if cfg!(debug_assertions) => { - bug!("Unexpected error during validation: {}", err) - } - Err(err) => Err(err), + Err(err) => bug!("Unexpected error during validation: {}", err), } } |
