diff options
| author | Oliver Schneider <git-spam-no-reply9815368754983@oli-obk.de> | 2017-11-20 12:48:08 +0100 |
|---|---|---|
| committer | Oliver Schneider <git-spam-no-reply9815368754983@oli-obk.de> | 2017-11-24 08:06:43 +0100 |
| commit | f7361a887005ea351a3ceabba8548fdec6ee27ff (patch) | |
| tree | 91399d459c3ac0384ef9ba2535936ff748ab1d15 | |
| parent | 7e07fd3e8d83b5feec2d6c3e5fb57de73681a9f3 (diff) | |
| download | rust-f7361a887005ea351a3ceabba8548fdec6ee27ff.tar.gz rust-f7361a887005ea351a3ceabba8548fdec6ee27ff.zip | |
This method of once-diagnostics doesn't allow nesting
| -rw-r--r-- | src/librustc/session/mod.rs | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs index 78015967428..b2f4acb21a8 100644 --- a/src/librustc/session/mod.rs +++ b/src/librustc/session/mod.rs @@ -355,7 +355,6 @@ impl Session { /// Analogous to calling methods on the given `DiagnosticBuilder`, but /// deduplicates on lint ID, span (if any), and message for this `Session` - /// if we're not outputting in JSON mode. fn diag_once<'a, 'b>(&'a self, diag_builder: &'b mut DiagnosticBuilder<'a>, method: DiagnosticBuilderMethod, @@ -371,20 +370,11 @@ impl Session { } }; - match self.opts.error_format { - // when outputting JSON for tool consumption, the tool might want - // the duplicates - config::ErrorOutputType::Json(_) => { - do_method() - }, - _ => { - let lint_id = DiagnosticMessageId::LintId(lint::LintId::of(lint)); - let id_span_message = (lint_id, span, message.to_owned()); - let fresh = self.one_time_diagnostics.borrow_mut().insert(id_span_message); - if fresh { - do_method() - } - } + let lint_id = DiagnosticMessageId::LintId(lint::LintId::of(lint)); + let id_span_message = (lint_id, span, message.to_owned()); + let fresh = self.one_time_diagnostics.borrow_mut().insert(id_span_message); + if fresh { + do_method() } } |
