1
Fork 0

Move some hard error logic to InterpError

This commit is contained in:
Smitty 2021-06-16 18:23:34 -04:00
parent 4fe4ff95f6
commit 044b3620e7
2 changed files with 27 additions and 15 deletions

View file

@ -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,
}
}
}