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),
|
IndexableLength(#[from] IndexableLengthError),
|
||||||
#[error("Operation {0:?} can't work with {1:?}")]
|
#[error("Operation {0:?} can't work with {1:?}")]
|
||||||
InvalidUnaryOperandType(crate::UnaryOperator, Handle<crate::Expression>),
|
InvalidUnaryOperandType(crate::UnaryOperator, Handle<crate::Expression>),
|
||||||
#[error("Operation {0:?} can't work with {1:?} and {2:?}")]
|
#[error("Operation {op:?} can't work with {lhs:?} and {rhs:?}")]
|
||||||
InvalidBinaryOperandTypes(
|
InvalidBinaryOperandTypes {
|
||||||
crate::BinaryOperator,
|
op: crate::BinaryOperator,
|
||||||
Handle<crate::Expression>,
|
lhs: Handle<crate::Expression>,
|
||||||
Handle<crate::Expression>,
|
rhs: Handle<crate::Expression>,
|
||||||
),
|
},
|
||||||
#[error("Selecting is not possible")]
|
#[error("Selecting is not possible")]
|
||||||
InvalidSelectTypes,
|
InvalidSelectTypes,
|
||||||
#[error("Relational argument {0:?} is not a boolean vector")]
|
#[error("Relational argument {0:?} is not a boolean vector")]
|
||||||
@ -847,7 +847,11 @@ impl super::Validator {
|
|||||||
function.expressions[right],
|
function.expressions[right],
|
||||||
right_inner
|
right_inner
|
||||||
);
|
);
|
||||||
return Err(ExpressionError::InvalidBinaryOperandTypes(op, left, right));
|
return Err(ExpressionError::InvalidBinaryOperandTypes {
|
||||||
|
op,
|
||||||
|
lhs: left,
|
||||||
|
rhs: right,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
ShaderStages::all()
|
ShaderStages::all()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user