From b7f8eba9fd6c2000a3d7a7a7cf86607d2730dbf8 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Tue, 25 Jul 2023 10:02:16 +0000 Subject: [PATCH] Inline a function that is only used once --- compiler/rustc_errors/src/lib.rs | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index 93f77b9cccd..bf19e0587a2 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -553,29 +553,13 @@ pub fn with_tty_emitter( sm: Option>, fallback_bundle: LazyFallbackBundle, ) -> Self { - Self::with_tty_emitter_and_flags( + let flags = + HandlerFlags { can_emit_warnings, treat_err_as_bug: None, ..Default::default() }; + let emitter = Box::new(EmitterWriter::stderr( ColorConfig::Auto, sm, None, fallback_bundle, - HandlerFlags { can_emit_warnings, treat_err_as_bug: None, ..Default::default() }, - None, - ) - } - - pub fn with_tty_emitter_and_flags( - color_config: ColorConfig, - sm: Option>, - fluent_bundle: Option>, - fallback_bundle: LazyFallbackBundle, - flags: HandlerFlags, - ice_file: Option, - ) -> Self { - let emitter = Box::new(EmitterWriter::stderr( - color_config, - sm, - fluent_bundle, - fallback_bundle, false, false, None, @@ -583,7 +567,7 @@ pub fn with_tty_emitter_and_flags( flags.track_diagnostics, TerminalUrl::No, )); - Self::with_emitter_and_flags(emitter, flags, ice_file) + Self::with_emitter_and_flags(emitter, flags, None) } pub fn with_emitter(