Move some hard error logic to InterpError
This commit is contained in:
parent
4fe4ff95f6
commit
044b3620e7
2 changed files with 27 additions and 15 deletions
|
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue