Skip to content

Commit 60ddcbc

Browse files
refactor(naga): use String for ExpressionError::WrongArgumentCount
1 parent 9a0ed3f commit 60ddcbc

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(
@@ -1017,7 +1017,7 @@ impl super::Validator {
10171017
(Some(arg1), None, None) => &[arg, arg1],
10181018
(Some(arg1), Some(arg2), None) => &[arg, arg1, arg2],
10191019
(Some(arg1), Some(arg2), Some(arg3)) => &[arg, arg1, arg2, arg3],
1020-
_ => return Err(ExpressionError::WrongArgumentCount(fun)),
1020+
_ => return Err(ExpressionError::WrongArgumentCount(format!("{fun:?}"))),
10211021
};
10221022

10231023
let resolve = |arg| &resolver[arg];
@@ -1066,7 +1066,7 @@ impl super::Validator {
10661066
}
10671067

10681068
if actuals.len() < overloads.min_arguments() {
1069-
return Err(ExpressionError::WrongArgumentCount(fun));
1069+
return Err(ExpressionError::WrongArgumentCount(format!("{fun:?}")));
10701070
}
10711071

10721072
ShaderStages::all()

0 commit comments

Comments
 (0)