mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-21 14:23:32 +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 {
|
||||
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],
|
||||
}
|
||||
|
||||
|
@ -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()),
|
||||
|
Loading…
Reference in New Issue
Block a user