diff options
| author | bors <bors@rust-lang.org> | 2024-02-17 18:20:41 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-02-17 18:20:41 +0000 |
| commit | cabdf3ad257693aa79ffcc4b7dd1fdab41dc209e (patch) | |
| tree | 0b9165c5f70c60fd421dcf652a9998e5e132034f /src/tools/rustfmt | |
| parent | 12b5498f3bcaa9f7b7641ed829873da0907b21dc (diff) | |
| parent | eafa74ab629df7d02dc73fde7db4027f90b2538a (diff) | |
| download | rust-cabdf3ad257693aa79ffcc4b7dd1fdab41dc209e.tar.gz rust-cabdf3ad257693aa79ffcc4b7dd1fdab41dc209e.zip | |
Auto merge of #121240 - matthiaskrgr:rollup-lfb5i9w, r=matthiaskrgr
Rollup of 9 pull requests Successful merges: - #120952 (Don't use mem::zeroed in vec::IntoIter) - #121085 (errors: only eagerly translate subdiagnostics) - #121091 (use build.rustc config and skip-stage0-validation flag) - #121149 (Fix typo in VecDeque::handle_capacity_increase() doc comment.) - #121193 (Use fulfillment in next trait solver coherence) - #121209 (Make `CodegenBackend::join_codegen` infallible.) - #121210 (Fix `cfg(target_abi = "sim")` on `i386-apple-ios`) - #121228 (create stamp file for clippy) - #121231 (remove a couple of redundant clones) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src/tools/rustfmt')
| -rw-r--r-- | src/tools/rustfmt/src/parse/session.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/tools/rustfmt/src/parse/session.rs b/src/tools/rustfmt/src/parse/session.rs index f0af401d3da..cff025cf2ab 100644 --- a/src/tools/rustfmt/src/parse/session.rs +++ b/src/tools/rustfmt/src/parse/session.rs @@ -1,3 +1,4 @@ +use std::borrow::Cow; use std::path::Path; use std::sync::atomic::{AtomicBool, Ordering}; @@ -40,6 +41,16 @@ impl Translate for SilentEmitter { fn fallback_fluent_bundle(&self) -> &rustc_errors::FluentBundle { panic!("silent emitter attempted to translate a diagnostic"); } + + // Override `translate_message` for the silent emitter because eager translation of + // subdiagnostics result in a call to this. + fn translate_message<'a>( + &'a self, + message: &'a rustc_errors::DiagnosticMessage, + _: &'a rustc_errors::translation::FluentArgs<'_>, + ) -> Result<Cow<'_, str>, rustc_errors::error::TranslateError<'_>> { + rustc_errors::emitter::silent_translate(message) + } } impl Emitter for SilentEmitter { |
