mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-25 00:03:29 +00:00
refactor: remove ConflictingDiagnosticRuleError::triggering_rule
Did this to decrease size of `ConflictingDiagnosticRuleError`, which would have gotten even bigger in a subsequent commit.
This commit is contained in:
parent
ffc2a1e9a0
commit
1fc5e4027a
@ -152,7 +152,6 @@ impl DiagnosticFilterMap {
|
|||||||
};
|
};
|
||||||
if first_severity != new_severity || should_conflict_on_full_duplicate {
|
if first_severity != new_severity || should_conflict_on_full_duplicate {
|
||||||
return Err(ConflictingDiagnosticRuleError {
|
return Err(ConflictingDiagnosticRuleError {
|
||||||
triggering_rule,
|
|
||||||
triggering_rule_spans: [first_span, span],
|
triggering_rule_spans: [first_span, span],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -190,7 +189,6 @@ impl IntoIterator for DiagnosticFilterMap {
|
|||||||
#[cfg(feature = "wgsl-in")]
|
#[cfg(feature = "wgsl-in")]
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub(crate) struct ConflictingDiagnosticRuleError {
|
pub(crate) struct ConflictingDiagnosticRuleError {
|
||||||
pub triggering_rule: FilterableTriggeringRule,
|
|
||||||
pub triggering_rule_spans: [Span; 2],
|
pub triggering_rule_spans: [Span; 2],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1034,15 +1034,11 @@ impl<'a> Error<'a> {
|
|||||||
.into()],
|
.into()],
|
||||||
},
|
},
|
||||||
Error::DiagnosticDuplicateTriggeringRule(ConflictingDiagnosticRuleError {
|
Error::DiagnosticDuplicateTriggeringRule(ConflictingDiagnosticRuleError {
|
||||||
ref triggering_rule,
|
|
||||||
triggering_rule_spans,
|
triggering_rule_spans,
|
||||||
}) => {
|
}) => {
|
||||||
let [first_span, second_span] = triggering_rule_spans;
|
let [first_span, second_span] = triggering_rule_spans;
|
||||||
ParseError {
|
ParseError {
|
||||||
message: format!(
|
message: "found conflicting `diagnostic(…)` rule(s)".into(),
|
||||||
"found conflicting `diagnostic(…)` rule(s) for `{}`",
|
|
||||||
triggering_rule.to_wgsl_ident()
|
|
||||||
),
|
|
||||||
labels: vec![
|
labels: vec![
|
||||||
(first_span, "first rule".into()),
|
(first_span, "first rule".into()),
|
||||||
(second_span, "second rule".into()),
|
(second_span, "second rule".into()),
|
||||||
|
Loading…
Reference in New Issue
Block a user