From 5753f6e1072849c76fc40b6ea85c41e93cac1da3 Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Tue, 18 May 2021 11:20:25 -0700 Subject: [PATCH] [wgsl-in] Improve error message for UnknownIdent. --- src/front/wgsl/mod.rs | 2 +- tests/wgsl-errors.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/front/wgsl/mod.rs b/src/front/wgsl/mod.rs index b557315e23..66feb04b5e 100644 --- a/src/front/wgsl/mod.rs +++ b/src/front/wgsl/mod.rs @@ -177,7 +177,7 @@ impl<'a> Error<'a> { notes: vec![], }, Error::UnknownIdent(ref ident_span, ident) => ParseError { - message: format!("unknown identifier: '{}'", ident), + message: format!("no definition in scope for identifier: '{}'", ident), labels: vec![(ident_span.clone(), "unknown identifier".into())], notes: vec![], }, diff --git a/tests/wgsl-errors.rs b/tests/wgsl-errors.rs index 87050a6de8..db70992d24 100644 --- a/tests/wgsl-errors.rs +++ b/tests/wgsl-errors.rs @@ -83,7 +83,7 @@ fn unknown_identifier() { return x * schmoo; } "###, - r###"error: unknown identifier: 'schmoo' + r###"error: no definition in scope for identifier: 'schmoo' ┌─ wgsl:3:30 │ 3 │ return x * schmoo;