From 1fc5e4027ab4eca9a00a030406c9ed52f81f8a1f Mon Sep 17 00:00:00 2001 From: Erich Gubler Date: Fri, 15 Nov 2024 08:57:06 -0500 Subject: [PATCH] refactor: remove `ConflictingDiagnosticRuleError::triggering_rule` Did this to decrease size of `ConflictingDiagnosticRuleError`, which would have gotten even bigger in a subsequent commit. --- naga/src/diagnostic_filter.rs | 2 -- naga/src/front/wgsl/error.rs | 6 +----- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/naga/src/diagnostic_filter.rs b/naga/src/diagnostic_filter.rs index bbfd9d58c..48fe44af3 100644 --- a/naga/src/diagnostic_filter.rs +++ b/naga/src/diagnostic_filter.rs @@ -152,7 +152,6 @@ impl DiagnosticFilterMap { }; if first_severity != new_severity || should_conflict_on_full_duplicate { return Err(ConflictingDiagnosticRuleError { - triggering_rule, triggering_rule_spans: [first_span, span], }); } @@ -190,7 +189,6 @@ impl IntoIterator for DiagnosticFilterMap { #[cfg(feature = "wgsl-in")] #[derive(Clone, Debug)] pub(crate) struct ConflictingDiagnosticRuleError { - pub triggering_rule: FilterableTriggeringRule, pub triggering_rule_spans: [Span; 2], } diff --git a/naga/src/front/wgsl/error.rs b/naga/src/front/wgsl/error.rs index 94570bcee..f827ca50f 100644 --- a/naga/src/front/wgsl/error.rs +++ b/naga/src/front/wgsl/error.rs @@ -1034,15 +1034,11 @@ impl<'a> Error<'a> { .into()], }, Error::DiagnosticDuplicateTriggeringRule(ConflictingDiagnosticRuleError { - ref triggering_rule, triggering_rule_spans, }) => { let [first_span, second_span] = triggering_rule_spans; ParseError { - message: format!( - "found conflicting `diagnostic(…)` rule(s) for `{}`", - triggering_rule.to_wgsl_ident() - ), + message: "found conflicting `diagnostic(…)` rule(s)".into(), labels: vec![ (first_span, "first rule".into()), (second_span, "second rule".into()),