]> git.lizzy.rs Git - rust.git/commitdiff
Use with_emitter instead of with_tty_emitter
authortopecongiro <seuchida@gmail.com>
Tue, 13 Jun 2017 00:18:14 +0000 (09:18 +0900)
committertopecongiro <seuchida@gmail.com>
Tue, 13 Jun 2017 00:18:14 +0000 (09:18 +0900)
src/lib.rs

index 6488c83e9831fa260e0bd0e88726188fcd9fce8f..219e98ef1e6d4e042ea98d5386ba0264f07dd2b8 100644 (file)
@@ -460,8 +460,9 @@ fn format_ast<F>(krate: &ast::Crate,
         }
         // Reset the error count.
         if parse_session.span_diagnostic.has_errors() {
-            parse_session.span_diagnostic =
-                Handler::with_tty_emitter(ColorConfig::Auto, true, false, Some(codemap.clone()));
+            let silent_emitter = Box::new(EmitterWriter::new(Box::new(Vec::new()),
+                                                             Some(codemap.clone())));
+            parse_session.span_diagnostic = Handler::with_emitter(true, false, silent_emitter);
         }
     }