diff --git a/naga/src/valid/expression.rs b/naga/src/valid/expression.rs index 7f693c13b..bf44e8608 100644 --- a/naga/src/valid/expression.rs +++ b/naga/src/valid/expression.rs @@ -39,12 +39,12 @@ pub enum ExpressionError { IndexableLength(#[from] IndexableLengthError), #[error("Operation {0:?} can't work with {1:?}")] InvalidUnaryOperandType(crate::UnaryOperator, Handle), - #[error("Operation {0:?} can't work with {1:?} and {2:?}")] - InvalidBinaryOperandTypes( - crate::BinaryOperator, - Handle, - Handle, - ), + #[error("Operation {op:?} can't work with {lhs:?} and {rhs:?}")] + InvalidBinaryOperandTypes { + op: crate::BinaryOperator, + lhs: Handle, + rhs: Handle, + }, #[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() }