diff --git a/src/front/wgsl/error.rs b/src/front/wgsl/error.rs index d45cd5ba80..a3355f861a 100644 --- a/src/front/wgsl/error.rs +++ b/src/front/wgsl/error.rs @@ -136,7 +136,6 @@ pub enum InvalidAssignmentType { } #[derive(Clone, Debug)] -#[cfg_attr(test, derive(PartialEq))] pub enum Error<'a> { Unexpected(Span, ExpectedToken<'a>), UnexpectedComponents(Span), diff --git a/src/front/wgsl/tests.rs b/src/front/wgsl/tests.rs index 9bf08e2ca3..cabb6f80bb 100644 --- a/src/front/wgsl/tests.rs +++ b/src/front/wgsl/tests.rs @@ -528,11 +528,12 @@ fn parse_repeated_attributes() { let name_length = attribute.rfind('(').unwrap_or(attribute.len()) as u32; let span_start = shader.rfind(attribute).unwrap() as u32; let span_end = span_start + name_length; + let expected_span = Span::new(span_start, span_end); let result = Frontend::new().inner(&shader); - assert_eq!( + assert!(matches!( result.unwrap_err(), - Error::RepeatedAttribute(Span::new(span_start, span_end)) - ); + Error::RepeatedAttribute(span) if span == expected_span + )); } }