Skip to content

Commit f3ad5a3

Browse files
refactor(naga): use String for ExpressionError::WrongArgumentCount
1 parent ffb6fc9 commit f3ad5a3

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

naga/src/valid/expression.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ pub enum ExpressionError {
128128
InvalidSampleLevelGradientType(crate::ImageDimension, Handle<crate::Expression>),
129129
#[error("Unable to cast")]
130130
InvalidCastArgument,
131-
#[error("Invalid argument count for {0:?}")]
132-
WrongArgumentCount(crate::MathFunction),
131+
#[error("Invalid argument count for {0}")]
132+
WrongArgumentCount(String),
133133
#[error("Argument [{1}] to {0:?} as expression {2:?} has an invalid type.")]
134134
InvalidArgumentType(String, u32, Handle<crate::Expression>),
135135
#[error(
@@ -1025,7 +1025,7 @@ impl super::Validator {
10251025
(Some(arg1), None, None) => &[arg, arg1],
10261026
(Some(arg1), Some(arg2), None) => &[arg, arg1, arg2],
10271027
(Some(arg1), Some(arg2), Some(arg3)) => &[arg, arg1, arg2, arg3],
1028-
_ => return Err(ExpressionError::WrongArgumentCount(fun)),
1028+
_ => return Err(ExpressionError::WrongArgumentCount(format!("{fun:?}"))),
10291029
};
10301030

10311031
let resolve = |arg| &resolver[arg];
@@ -1074,7 +1074,7 @@ impl super::Validator {
10741074
}
10751075

10761076
if actuals.len() < overloads.min_arguments() {
1077-
return Err(ExpressionError::WrongArgumentCount(fun));
1077+
return Err(ExpressionError::WrongArgumentCount(format!("{fun:?}")));
10781078
}
10791079

10801080
ShaderStages::all()

0 commit comments

Comments
 (0)