Skip to content

Commit 795a4fd

Browse files
committed
Revert "Filtering spans"
This reverts commit d652f0ea588ecdf96d31a86fcc9aaa5f78f734a2.
1 parent 2db95d0 commit 795a4fd

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

compiler/rustc_errors/src/json.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ impl Diagnostic {
319319
message: translated_message.to_string(),
320320
code: None,
321321
level: "help",
322-
spans: Self::filter_empty_spans_with_no_replacement(DiagnosticSpan::from_suggestion(sugg, &args, je)),
322+
spans: DiagnosticSpan::from_suggestion(sugg, &args, je),
323323
children: vec![],
324324
rendered: None,
325325
}
@@ -372,12 +372,6 @@ impl Diagnostic {
372372
}
373373
}
374374

375-
fn filter_empty_spans_with_no_replacement(spans: Vec<DiagnosticSpan>) -> Vec<DiagnosticSpan> {
376-
spans.into_iter()
377-
.filter(|span| !(span.byte_start == span.byte_end && span.suggested_replacement == Some(String::new())))
378-
.collect()
379-
}
380-
381375
fn from_sub_diagnostic(
382376
diag: &SubDiagnostic,
383377
args: &FluentArgs<'_>,

0 commit comments

Comments
 (0)