From f6f0e5dbc2db73ee87eda06e91e9f131eb5ff44b Mon Sep 17 00:00:00 2001 From: Erich Gubler Date: Fri, 8 Nov 2024 12:09:08 -0500 Subject: [PATCH] refactor(naga): unimpl. `Copy for FilterableTriggeringRule` --- naga/src/diagnostic_filter.rs | 8 ++++---- naga/src/front/wgsl/diagnostic_filter.rs | 2 +- naga/src/front/wgsl/error.rs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/naga/src/diagnostic_filter.rs b/naga/src/diagnostic_filter.rs index 29499fbae..bbfd9d58c 100644 --- a/naga/src/diagnostic_filter.rs +++ b/naga/src/diagnostic_filter.rs @@ -54,7 +54,7 @@ impl Severity { /// A filterable triggering rule in a [`DiagnosticFilter`]. /// /// -#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] +#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] @@ -140,7 +140,7 @@ impl DiagnosticFilterMap { triggering_rule, } = diagnostic_filter; - match diagnostic_filters.entry(triggering_rule) { + match diagnostic_filters.entry(triggering_rule.clone()) { Entry::Vacant(entry) => { entry.insert((new_severity, span)); } @@ -245,11 +245,11 @@ impl DiagnosticFilterNode { let node = &arena[handle]; let &Self { ref inner, parent } = node; let &DiagnosticFilter { - triggering_rule: rule, + triggering_rule: ref rule, new_severity, } = inner; - if rule == triggering_rule { + if rule == &triggering_rule { return new_severity; } diff --git a/naga/src/front/wgsl/diagnostic_filter.rs b/naga/src/front/wgsl/diagnostic_filter.rs index f505205b6..ed37ef7fe 100644 --- a/naga/src/front/wgsl/diagnostic_filter.rs +++ b/naga/src/front/wgsl/diagnostic_filter.rs @@ -30,7 +30,7 @@ impl FilterableTriggeringRule { } /// Maps this [`FilterableTriggeringRule`] into the sentinel word associated with it in WGSL. - pub const fn to_wgsl_ident(self) -> &'static str { + pub const fn to_wgsl_ident(&self) -> &'static str { match self { Self::DerivativeUniformity => Self::DERIVATIVE_UNIFORMITY, } diff --git a/naga/src/front/wgsl/error.rs b/naga/src/front/wgsl/error.rs index 26199b5e5..e9f7e2861 100644 --- a/naga/src/front/wgsl/error.rs +++ b/naga/src/front/wgsl/error.rs @@ -1034,7 +1034,7 @@ impl<'a> Error<'a> { .into()], }, Error::DiagnosticDuplicateTriggeringRule(ConflictingDiagnosticRuleError { - triggering_rule, + ref triggering_rule, triggering_rule_spans, }) => { let [first_span, second_span] = triggering_rule_spans;