Skip to content

Commit fe21cdc

Browse files
refactor(naga): use String for ExpressionError::WrongArgumentCount
1 parent f6949d9 commit fe21cdc

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

10191019
let resolve = |arg| &resolver[arg];
@@ -1062,7 +1062,7 @@ impl super::Validator {
10621062
}
10631063

10641064
if actuals.len() < overloads.min_arguments() {
1065-
return Err(ExpressionError::WrongArgumentCount(fun));
1065+
return Err(ExpressionError::WrongArgumentCount(format!("{fun:?}")));
10661066
}
10671067

10681068
ShaderStages::all()

0 commit comments

Comments
 (0)