diff options
| author | bors <bors@rust-lang.org> | 2024-03-24 16:09:51 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-03-24 16:09:51 +0000 |
| commit | d36bdd19f2940876e84d4e68f2ec3832507b3a33 (patch) | |
| tree | 023271c928991b253dc6d143dd9cbc039bb6cae4 /compiler/rustc_errors | |
| parent | 6e6c72174207174077905315d13cbf7ed9043475 (diff) | |
| parent | cdf86bf4430a6b068eb2acec2c5bbf4f87ee1118 (diff) | |
| download | rust-d36bdd19f2940876e84d4e68f2ec3832507b3a33.tar.gz rust-d36bdd19f2940876e84d4e68f2ec3832507b3a33.zip | |
Auto merge of #123004 - matthiaskrgr:rollup-s3v4p50, r=matthiaskrgr
Rollup of 10 pull requests Successful merges: - #122737 (conditionally ignore fatal diagnostic in the SilentEmitter) - #122757 (Fixed the `private-dependency` bug) - #122886 (add test for #90192) - #122937 (Unbox and unwrap the contents of `StatementKind::Coverage`) - #122949 (Add a regression test for #117310) - #122962 (Track run-make-support lib in common inputs stamp) - #122977 (Rename `Arguments::as_const_str` to `as_statically_known_str`) - #122983 (Fix build failure on ARM/AArch64/PowerPC/RISC-V FreeBSD/NetBSD) - #122984 (panic-in-panic-hook: formatting a message that's just a string is risk-free) - #122992 (std::thread: refine available_parallelism for solaris/illumos.) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_errors')
| -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, }) }); } |
