Skip to content

Commit 66f9526

Browse files
jimblandyteoxoy
authored andcommitted
[naga wgsl-in]: Rename error variant field for clarity.
Rename `naga::front::wgsl::error::Error::MissingTemplateArg::arg` to `description`, to make it a little more specific.
1 parent 63d6c34 commit 66f9526

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

naga/src/front/wgsl/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ pub(crate) enum Error<'a> {
431431
UnexpectedTemplate(Span),
432432
MissingTemplateArg {
433433
span: Span,
434-
arg: &'static str,
434+
description: &'static str,
435435
},
436436
UnexpectedExprForTypeExpression(Span),
437437
}
@@ -1460,7 +1460,7 @@ impl<'a> Error<'a> {
14601460
},
14611461
Error::MissingTemplateArg {
14621462
span,
1463-
arg,
1463+
description: arg,
14641464
} => ParseError {
14651465
message: format!(
14661466
"`{}` needs a template argument specified: {arg}",

naga/src/front/wgsl/lower/template_list.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ impl<'iter, 'source> TemplateListIter<'iter, 'source> {
4242

4343
fn expect_next(
4444
&mut self,
45-
arg: &'static str,
45+
description: &'static str,
4646
) -> Result<'source, Handle<ast::Expression<'source>>> {
4747
if let Some(expr) = self.template_list.next() {
4848
Ok(*expr)
4949
} else {
5050
Err(Box::new(Error::MissingTemplateArg {
5151
span: self.ident_span,
52-
arg,
52+
description,
5353
}))
5454
}
5555
}

0 commit comments

Comments
 (0)