Derive PartialEq for validation errors

This commit is contained in:
Dzmitry Malyshau 2020-11-19 23:06:46 -05:00 committed by Dzmitry Malyshau
parent 929e07ff0c
commit 4ed91330cf
2 changed files with 6 additions and 6 deletions

View File

@ -41,7 +41,7 @@ pub struct Typifier {
resolutions: Vec<Resolution>,
}
#[derive(Clone, Debug, Error)]
#[derive(Clone, Debug, Error, PartialEq)]
pub enum ResolveError {
#[error("Invalid index into array")]
InvalidAccessIndex,

View File

@ -13,7 +13,7 @@ pub struct Validator {
typifier: Typifier,
}
#[derive(Clone, Debug, thiserror::Error)]
#[derive(Clone, Debug, PartialEq, thiserror::Error)]
pub enum GlobalVariableError {
#[error("Usage isn't compatible with the storage class")]
InvalidUsage,
@ -32,7 +32,7 @@ pub enum GlobalVariableError {
OutOfRangeBinding,
}
#[derive(Clone, Debug, thiserror::Error)]
#[derive(Clone, Debug, PartialEq, thiserror::Error)]
pub enum LocalVariableError {
#[error("Initializer is not a constant expression")]
InitializerConst,
@ -40,7 +40,7 @@ pub enum LocalVariableError {
InitializerType,
}
#[derive(Clone, Debug, thiserror::Error)]
#[derive(Clone, Debug, PartialEq, thiserror::Error)]
pub enum FunctionError {
#[error(transparent)]
Resolve(#[from] ResolveError),
@ -54,7 +54,7 @@ pub enum FunctionError {
},
}
#[derive(Clone, Debug, thiserror::Error)]
#[derive(Clone, Debug, PartialEq, thiserror::Error)]
pub enum EntryPointError {
#[error("Early depth test is not applicable")]
UnexpectedEarlyDepthTest,
@ -74,7 +74,7 @@ pub enum EntryPointError {
Function(#[from] FunctionError),
}
#[derive(Clone, Debug, thiserror::Error)]
#[derive(Clone, Debug, PartialEq, thiserror::Error)]
pub enum ValidationError {
#[error("The type {0:?} width {1} is not supported")]
InvalidTypeWidth(crate::ScalarKind, crate::Bytes),