]> git.lizzy.rs Git - rust.git/commitdiff
This method of once-diagnostics doesn't allow nesting
authorOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>
Mon, 20 Nov 2017 11:48:08 +0000 (12:48 +0100)
committerOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>
Fri, 24 Nov 2017 07:06:43 +0000 (08:06 +0100)
src/librustc/session/mod.rs

index 780159674289e2579793cb1a444f0b1de95a89a1..b2f4acb21a8cfa16d893cc8bde89cbdbb35c9515 100644 (file)
@@ -355,7 +355,6 @@ pub fn diagnostic<'a>(&'a self) -> &'a errors::Handler {
 
     /// 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 @@ fn diag_once<'a, 'b>(&'a self,
             }
         };
 
-        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()
         }
     }