about summary refs log tree commit diff
path: root/compiler/rustc_errors/src
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-02-29 15:37:38 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2024-02-29 17:50:23 +1100
commit067d7c3d00a05989bd4b7d4b5648d61748f80848 (patch)
tree7549190b9caba8c9713aff4d7e3fed7c1cfb5162 /compiler/rustc_errors/src
parent437325bdd4e5fc54b0f78491e63fa386ebfffbba (diff)
downloadrust-067d7c3d00a05989bd4b7d4b5648d61748f80848.tar.gz
rust-067d7c3d00a05989bd4b7d4b5648d61748f80848.zip
Inline and remove `HumanEmitter::stderr`.
Because `HumanEmitter::new` is enough, in conjunction with the (renamed)
`stderr_destination` function.
Diffstat (limited to 'compiler/rustc_errors/src')
-rw-r--r--compiler/rustc_errors/src/emitter.rs6
-rw-r--r--compiler/rustc_errors/src/json/tests.rs1
2 files changed, 2 insertions, 5 deletions
diff --git a/compiler/rustc_errors/src/emitter.rs b/compiler/rustc_errors/src/emitter.rs
index ff105b4d46f..87e4a5ead4d 100644
--- a/compiler/rustc_errors/src/emitter.rs
+++ b/compiler/rustc_errors/src/emitter.rs
@@ -646,10 +646,6 @@ pub(crate) struct FileWithAnnotatedLines {
 }
 
 impl HumanEmitter {
-    pub fn stderr(color_config: ColorConfig, fallback_bundle: LazyFallbackBundle) -> HumanEmitter {
-        Self::new(from_stderr(color_config), fallback_bundle)
-    }
-
     pub fn new(dst: Destination, fallback_bundle: LazyFallbackBundle) -> HumanEmitter {
         HumanEmitter {
             dst: IntoDynSyncSend(dst),
@@ -2650,7 +2646,7 @@ impl WriteColor for Buffy {
     }
 }
 
-fn from_stderr(color: ColorConfig) -> Destination {
+pub fn stderr_destination(color: ColorConfig) -> Destination {
     let choice = color.to_color_choice();
     // On Windows we'll be performing global synchronization on the entire
     // system for emitting rustc errors, so there's no need to buffer
diff --git a/compiler/rustc_errors/src/json/tests.rs b/compiler/rustc_errors/src/json/tests.rs
index e541f4ca7d4..fc9948cb2fc 100644
--- a/compiler/rustc_errors/src/json/tests.rs
+++ b/compiler/rustc_errors/src/json/tests.rs
@@ -1,6 +1,7 @@
 use super::*;
 
 use crate::DiagCtxt;
+use rustc_span::source_map::FilePathMapping;
 use rustc_span::BytePos;
 
 use std::str;