Skip to content

Commit 8d60f75

Browse files
committed
Remove some arguments that are always the same
1 parent ff8fe76 commit 8d60f75

File tree

2 files changed

+7
-27
lines changed

2 files changed

+7
-27
lines changed

compiler/rustc_errors/src/lib.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -549,21 +549,17 @@ impl Drop for HandlerInner {
549549

550550
impl Handler {
551551
pub fn with_tty_emitter(
552-
color_config: ColorConfig,
553552
can_emit_warnings: bool,
554-
treat_err_as_bug: Option<NonZeroUsize>,
555553
sm: Option<Lrc<SourceMap>>,
556-
fluent_bundle: Option<Lrc<FluentBundle>>,
557554
fallback_bundle: LazyFallbackBundle,
558-
ice_file: Option<PathBuf>,
559555
) -> Self {
560556
Self::with_tty_emitter_and_flags(
561-
color_config,
557+
ColorConfig::Auto,
562558
sm,
563-
fluent_bundle,
559+
None,
564560
fallback_bundle,
565-
HandlerFlags { can_emit_warnings, treat_err_as_bug, ..Default::default() },
566-
ice_file,
561+
HandlerFlags { can_emit_warnings, treat_err_as_bug: None, ..Default::default() },
562+
None,
567563
)
568564
}
569565

compiler/rustc_session/src/parse.rs

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::lint::{
99
use rustc_ast::node_id::NodeId;
1010
use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexSet};
1111
use rustc_data_structures::sync::{AppendOnlyVec, AtomicBool, Lock, Lrc};
12-
use rustc_errors::{emitter::SilentEmitter, ColorConfig, Handler};
12+
use rustc_errors::{emitter::SilentEmitter, Handler};
1313
use rustc_errors::{
1414
fallback_fluent_bundle, Diagnostic, DiagnosticBuilder, DiagnosticId, DiagnosticMessage,
1515
EmissionGuarantee, ErrorGuaranteed, IntoDiagnostic, MultiSpan, Noted, StashKey,
@@ -224,15 +224,7 @@ impl ParseSess {
224224
pub fn new(locale_resources: Vec<&'static str>, file_path_mapping: FilePathMapping) -> Self {
225225
let fallback_bundle = fallback_fluent_bundle(locale_resources, false);
226226
let sm = Lrc::new(SourceMap::new(file_path_mapping));
227-
let handler = Handler::with_tty_emitter(
228-
ColorConfig::Auto,
229-
true,
230-
None,
231-
Some(sm.clone()),
232-
None,
233-
fallback_bundle,
234-
None,
235-
);
227+
let handler = Handler::with_tty_emitter(true, Some(sm.clone()), fallback_bundle);
236228
ParseSess::with_span_handler(handler, sm)
237229
}
238230

@@ -262,15 +254,7 @@ impl ParseSess {
262254
pub fn with_silent_emitter(fatal_note: Option<String>) -> Self {
263255
let fallback_bundle = fallback_fluent_bundle(Vec::new(), false);
264256
let sm = Lrc::new(SourceMap::new(FilePathMapping::empty()));
265-
let fatal_handler = Handler::with_tty_emitter(
266-
ColorConfig::Auto,
267-
false,
268-
None,
269-
None,
270-
None,
271-
fallback_bundle,
272-
None,
273-
);
257+
let fatal_handler = Handler::with_tty_emitter(false, None, fallback_bundle);
274258
let handler = Handler::with_emitter(
275259
false,
276260
None,

0 commit comments

Comments
 (0)