Skip to content

Commit f7361a8

Browse files
committed
This method of once-diagnostics doesn't allow nesting
1 parent 7e07fd3 commit f7361a8

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

src/librustc/session/mod.rs

+5-15
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,6 @@ impl Session {
355355

356356
/// Analogous to calling methods on the given `DiagnosticBuilder`, but
357357
/// deduplicates on lint ID, span (if any), and message for this `Session`
358-
/// if we're not outputting in JSON mode.
359358
fn diag_once<'a, 'b>(&'a self,
360359
diag_builder: &'b mut DiagnosticBuilder<'a>,
361360
method: DiagnosticBuilderMethod,
@@ -371,20 +370,11 @@ impl Session {
371370
}
372371
};
373372

374-
match self.opts.error_format {
375-
// when outputting JSON for tool consumption, the tool might want
376-
// the duplicates
377-
config::ErrorOutputType::Json(_) => {
378-
do_method()
379-
},
380-
_ => {
381-
let lint_id = DiagnosticMessageId::LintId(lint::LintId::of(lint));
382-
let id_span_message = (lint_id, span, message.to_owned());
383-
let fresh = self.one_time_diagnostics.borrow_mut().insert(id_span_message);
384-
if fresh {
385-
do_method()
386-
}
387-
}
373+
let lint_id = DiagnosticMessageId::LintId(lint::LintId::of(lint));
374+
let id_span_message = (lint_id, span, message.to_owned());
375+
let fresh = self.one_time_diagnostics.borrow_mut().insert(id_span_message);
376+
if fresh {
377+
do_method()
388378
}
389379
}
390380

0 commit comments

Comments
 (0)