Skip to content

Commit

Permalink
Use builder pattern instead of lots of arguments for `EmitterWriter::…
Browse files Browse the repository at this point in the history
…new`
  • Loading branch information
oli-obk committed Jul 31, 2023
1 parent 1f369f8 commit aac383e
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions src/parse/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit aac383e

Please sign in to comment.