mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-21 22:33:49 +00:00
refactor(naga): use named fields for ExpressionError::InvalidBinaryOperandTypes
This commit is contained in:
parent
ea75a8ced4
commit
2a2655def8
@ -39,12 +39,12 @@ pub enum ExpressionError {
|
||||
IndexableLength(#[from] IndexableLengthError),
|
||||
#[error("Operation {0:?} can't work with {1:?}")]
|
||||
InvalidUnaryOperandType(crate::UnaryOperator, Handle<crate::Expression>),
|
||||
#[error("Operation {0:?} can't work with {1:?} and {2:?}")]
|
||||
InvalidBinaryOperandTypes(
|
||||
crate::BinaryOperator,
|
||||
Handle<crate::Expression>,
|
||||
Handle<crate::Expression>,
|
||||
),
|
||||
#[error("Operation {op:?} can't work with {lhs:?} and {rhs:?}")]
|
||||
InvalidBinaryOperandTypes {
|
||||
op: crate::BinaryOperator,
|
||||
lhs: Handle<crate::Expression>,
|
||||
rhs: Handle<crate::Expression>,
|
||||
},
|
||||
#[error("Selecting is not possible")]
|
||||
InvalidSelectTypes,
|
||||
#[error("Relational argument {0:?} is not a boolean vector")]
|
||||
@ -847,7 +847,11 @@ impl super::Validator {
|
||||
function.expressions[right],
|
||||
right_inner
|
||||
);
|
||||
return Err(ExpressionError::InvalidBinaryOperandTypes(op, left, right));
|
||||
return Err(ExpressionError::InvalidBinaryOperandTypes {
|
||||
op,
|
||||
lhs: left,
|
||||
rhs: right,
|
||||
});
|
||||
}
|
||||
ShaderStages::all()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user