Skip to content

Commit 1e382d2

Browse files
refactor(naga): use String for ExpressionError::InvalidArgumentType's op. description
1 parent 009f0bf commit 1e382d2

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

naga/src/valid/expression.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use alloc::{format, string::String};
2+
13
use super::{compose::validate_compose, FunctionInfo, ModuleInfo, ShaderStages, TypeFlags};
24
use crate::arena::UniqueArena;
35
use crate::{
@@ -129,7 +131,7 @@ pub enum ExpressionError {
129131
#[error("Invalid argument count for {0:?}")]
130132
WrongArgumentCount(crate::MathFunction),
131133
#[error("Argument [{1}] to {0:?} as expression {2:?} has an invalid type.")]
132-
InvalidArgumentType(crate::MathFunction, u32, Handle<crate::Expression>),
134+
InvalidArgumentType(String, u32, Handle<crate::Expression>),
133135
#[error(
134136
"workgroupUniformLoad result type can't be {0:?}. It can only be a constructible type."
135137
)]
@@ -1055,7 +1057,11 @@ impl super::Validator {
10551057

10561058
if overloads.is_empty() {
10571059
log::debug!("all overloads eliminated");
1058-
return Err(ExpressionError::InvalidArgumentType(fun, i as u32, expr));
1060+
return Err(ExpressionError::InvalidArgumentType(
1061+
format!("{fun:?}"),
1062+
i as u32,
1063+
expr,
1064+
));
10591065
}
10601066
}
10611067

0 commit comments

Comments
 (0)