diff options
| author | Smitty <me@smitop.com> | 2021-06-16 18:23:34 -0400 |
|---|---|---|
| committer | Smitty <me@smitop.com> | 2021-06-16 18:23:34 -0400 |
| commit | 044b3620e7f3d495e859113ecc6aa55e37ddc228 (patch) | |
| tree | b1950166e3c085757ee4cc013a3db8b79b31da99 /compiler/rustc_middle | |
| parent | 4fe4ff95f6c459d98c2449c9993e0f7e0b8c47d3 (diff) | |
| download | rust-044b3620e7f3d495e859113ecc6aa55e37ddc228.tar.gz rust-044b3620e7f3d495e859113ecc6aa55e37ddc228.zip | |
Move some hard error logic to InterpError
Diffstat (limited to 'compiler/rustc_middle')
| -rw-r--r-- | compiler/rustc_middle/src/mir/interpret/error.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/mir/interpret/error.rs b/compiler/rustc_middle/src/mir/interpret/error.rs index 65d9c1dd90e..cce360713b5 100644 --- a/compiler/rustc_middle/src/mir/interpret/error.rs +++ b/compiler/rustc_middle/src/mir/interpret/error.rs @@ -502,4 +502,14 @@ impl InterpError<'_> { _ => false, } } + + /// Should this error be reported as a hard error, preventing compilation, or a soft error, + /// causing a deny-by-default lint? + pub fn is_hard_err(&self) -> bool { + use InterpError::*; + match *self { + MachineStop(ref err) => err.is_hard_err(), + _ => false, + } + } } |
