diff options
| author | bors <bors@rust-lang.org> | 2024-03-25 16:34:41 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-03-25 16:34:41 +0000 |
| commit | cf1eb93a02349d31f96ab2737b6f15cf6e6df534 (patch) | |
| tree | 8c1145dcdf2031d5872f17329803a6c60b42c31a /compiler/rustc_errors/src | |
| parent | c4611708bd510a17d36d385e9bb70b19283de051 (diff) | |
| parent | 0d4ef69d66ed32f23fc1006fdd26911e42eba460 (diff) | |
| download | rust-cf1eb93a02349d31f96ab2737b6f15cf6e6df534.tar.gz rust-cf1eb93a02349d31f96ab2737b6f15cf6e6df534.zip | |
Auto merge of #3414 - RalfJung:rustup, r=RalfJung
Rustup Fixes https://github.com/rust-lang/miri/issues/3404
Diffstat (limited to 'compiler/rustc_errors/src')
| -rw-r--r-- | compiler/rustc_errors/src/emitter.rs | 3 | ||||
| -rw-r--r-- | compiler/rustc_errors/src/lib.rs | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/compiler/rustc_errors/src/emitter.rs b/compiler/rustc_errors/src/emitter.rs index fceccb7e9b6..bd8e78bda26 100644 --- a/compiler/rustc_errors/src/emitter.rs +++ b/compiler/rustc_errors/src/emitter.rs @@ -541,6 +541,7 @@ pub struct SilentEmitter { pub fallback_bundle: LazyFallbackBundle, pub fatal_dcx: DiagCtxt, pub fatal_note: Option<String>, + pub emit_fatal_diagnostic: bool, } impl Translate for SilentEmitter { @@ -561,7 +562,7 @@ impl Emitter for SilentEmitter { } fn emit_diagnostic(&mut self, mut diag: DiagInner) { - if diag.level == Level::Fatal { + if self.emit_fatal_diagnostic && diag.level == Level::Fatal { if let Some(fatal_note) = &self.fatal_note { diag.sub(Level::Note, fatal_note.clone(), MultiSpan::new()); } diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index 238bc63ec58..7b40954e735 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -612,12 +612,18 @@ impl DiagCtxt { Self { inner: Lock::new(DiagCtxtInner::new(emitter)) } } - pub fn make_silent(&mut self, fallback_bundle: LazyFallbackBundle, fatal_note: Option<String>) { + pub fn make_silent( + &mut self, + fallback_bundle: LazyFallbackBundle, + fatal_note: Option<String>, + emit_fatal_diagnostic: bool, + ) { self.wrap_emitter(|old_dcx| { Box::new(emitter::SilentEmitter { fallback_bundle, fatal_dcx: DiagCtxt { inner: Lock::new(old_dcx) }, fatal_note, + emit_fatal_diagnostic, }) }); } |
