diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-07-25 13:25:38 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-07-31 09:34:30 +0000 |
| commit | 0e7ec9683dae0a0bc66797b1351059ed642f4e2d (patch) | |
| tree | 5c670cce44d13c300f1bdfe5b5de0c0729a32b5c /src/tools/rustfmt | |
| parent | 29de70da1be1c71b89b006f9955fedc70e084067 (diff) | |
| download | rust-0e7ec9683dae0a0bc66797b1351059ed642f4e2d.tar.gz rust-0e7ec9683dae0a0bc66797b1351059ed642f4e2d.zip | |
Use builder pattern instead of lots of arguments for `EmitterWriter::new`
Diffstat (limited to 'src/tools/rustfmt')
| -rw-r--r-- | src/tools/rustfmt/src/parse/session.rs | 15 |
1 files changed, 2 insertions, 13 deletions
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, |
