use matches!() macro in more places
This commit is contained in:
parent
3cd3bbecc5
commit
0a5640b55f
21 changed files with 49 additions and 86 deletions
|
@ -538,12 +538,12 @@ impl InterpError<'_> {
|
|||
/// To avoid performance issues, there are places where we want to be sure to never raise these formatting errors,
|
||||
/// so this method lets us detect them and `bug!` on unexpected errors.
|
||||
pub fn formatted_string(&self) -> bool {
|
||||
match self {
|
||||
matches!(
|
||||
self,
|
||||
InterpError::Unsupported(UnsupportedOpInfo::Unsupported(_))
|
||||
| InterpError::UndefinedBehavior(UndefinedBehaviorInfo::ValidationFailure { .. })
|
||||
| InterpError::UndefinedBehavior(UndefinedBehaviorInfo::Ub(_)) => true,
|
||||
_ => false,
|
||||
}
|
||||
| InterpError::UndefinedBehavior(UndefinedBehaviorInfo::ValidationFailure { .. })
|
||||
| InterpError::UndefinedBehavior(UndefinedBehaviorInfo::Ub(_))
|
||||
)
|
||||
}
|
||||
|
||||
/// Should this error be reported as a hard error, preventing compilation, or a soft error,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue