about summary refs log tree commit diff
path: root/src/tools
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2023-07-25 13:25:38 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2023-07-31 09:34:30 +0000
commit0e7ec9683dae0a0bc66797b1351059ed642f4e2d (patch)
tree5c670cce44d13c300f1bdfe5b5de0c0729a32b5c /src/tools
parent29de70da1be1c71b89b006f9955fedc70e084067 (diff)
downloadrust-0e7ec9683dae0a0bc66797b1351059ed642f4e2d.tar.gz
rust-0e7ec9683dae0a0bc66797b1351059ed642f4e2d.zip
Use builder pattern instead of lots of arguments for `EmitterWriter::new`
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/clippy/clippy_lints/src/doc.rs10
-rw-r--r--src/tools/rustfmt/src/parse/session.rs15
2 files changed, 3 insertions, 22 deletions
diff --git a/src/tools/clippy/clippy_lints/src/doc.rs b/src/tools/clippy/clippy_lints/src/doc.rs
index 00f70e586f4..573838ce63e 100644
--- a/src/tools/clippy/clippy_lints/src/doc.rs
+++ b/src/tools/clippy/clippy_lints/src/doc.rs
@@ -16,7 +16,7 @@ use rustc_ast::token::CommentKind;
 use rustc_data_structures::fx::FxHashSet;
 use rustc_data_structures::sync::Lrc;
 use rustc_errors::emitter::EmitterWriter;
-use rustc_errors::{Applicability, Handler, SuggestionStyle, TerminalUrl};
+use rustc_errors::{Applicability, Handler, SuggestionStyle};
 use rustc_hir as hir;
 use rustc_hir::intravisit::{self, Visitor};
 use rustc_hir::{AnonConst, Expr};
@@ -718,16 +718,8 @@ fn check_code(cx: &LateContext<'_>, text: &str, edition: Edition, span: Span) {
                     rustc_errors::fallback_fluent_bundle(rustc_driver::DEFAULT_LOCALE_RESOURCES.to_vec(), false);
                 let emitter = EmitterWriter::new(
                     Box::new(io::sink()),
-                    None,
-                    None,
                     fallback_bundle,
                     false,
-                    false,
-                    false,
-                    None,
-                    false,
-                    false,
-                    TerminalUrl::No,
                 );
                 let handler = Handler::with_emitter(Box::new(emitter)).disable_warnings();
                 let sess = ParseSess::with_span_handler(handler, sm);
diff --git a/src/tools/rustfmt/src/parse/session.rs b/src/tools/rustfmt/src/parse/session.rs
index aa75b477473..945e3e42fdd 100644
--- a/src/tools/rustfmt/src/parse/session.rs
+++ b/src/tools/rustfmt/src/parse/session.rs
@@ -4,7 +4,7 @@ use std::sync::atomic::{AtomicBool, Ordering};
 use rustc_data_structures::sync::{Lrc, Send};
 use rustc_errors::emitter::{Emitter, EmitterWriter};
 use rustc_errors::translation::Translate;
-use rustc_errors::{ColorConfig, Diagnostic, Handler, Level as DiagnosticLevel, TerminalUrl};
+use rustc_errors::{ColorConfig, Diagnostic, Handler, Level as DiagnosticLevel};
 use rustc_session::parse::ParseSess as RawParseSess;
 use rustc_span::{
     source_map::{FilePathMapping, SourceMap},
@@ -139,18 +139,7 @@ fn default_handler(
             rustc_driver::DEFAULT_LOCALE_RESOURCES.to_vec(),
             false,
         );
-        Box::new(EmitterWriter::stderr(
-            emit_color,
-            Some(source_map.clone()),
-            None,
-            fallback_bundle,
-            false,
-            false,
-            None,
-            false,
-            false,
-            TerminalUrl::No,
-        ))
+        Box::new(EmitterWriter::stderr(emit_color, fallback_bundle).sm(Some(source_map.clone())))
     };
     Handler::with_emitter(Box::new(SilentOnIgnoredFilesEmitter {
         has_non_ignorable_parser_errors: false,