Skip to content

Commit 400a4d4

Browse files
committed
Rename SilentEmitter -> FatalEmitter
1 parent c694499 commit 400a4d4

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

compiler/rustc_errors/src/emitter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,13 +533,13 @@ impl Emitter for HumanEmitter {
533533
/// An emitter that does nothing when emitting a non-fatal diagnostic.
534534
/// Fatal diagnostics are forwarded to `fatal_emitter` to avoid silent
535535
/// failures of rustc, as witnessed e.g. in issue #89358.
536-
pub struct SilentEmitter {
536+
pub struct FatalEmitter {
537537
pub fatal_emitter: Box<dyn Emitter + DynSend>,
538538
pub fatal_note: Option<String>,
539539
pub emit_fatal_diagnostic: bool,
540540
}
541541

542-
impl Emitter for SilentEmitter {
542+
impl Emitter for FatalEmitter {
543543
fn source_map(&self) -> Option<&SourceMap> {
544544
None
545545
}

compiler/rustc_errors/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ impl DiagCtxt {
766766
let mut inner = self.inner.borrow_mut();
767767
let mut prev_emitter = Box::new(FalseEmitter) as Box<dyn Emitter + DynSend>;
768768
std::mem::swap(&mut inner.emitter, &mut prev_emitter);
769-
let new_emitter = Box::new(emitter::SilentEmitter {
769+
let new_emitter = Box::new(emitter::FatalEmitter {
770770
fatal_emitter: prev_emitter,
771771
fatal_note,
772772
emit_fatal_diagnostic,

compiler/rustc_interface/src/interface.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub struct Compiler {
5252
pub(crate) fn parse_cfg(dcx: DiagCtxtHandle<'_>, cfgs: Vec<String>) -> Cfg {
5353
cfgs.into_iter()
5454
.map(|s| {
55-
let psess = ParseSess::with_silent_emitter(
55+
let psess = ParseSess::with_fatal_emitter(
5656
vec![crate::DEFAULT_LOCALE_RESOURCE, rustc_parse::DEFAULT_LOCALE_RESOURCE],
5757
format!("this error occurred on the command line: `--cfg={s}`"),
5858
true,
@@ -116,7 +116,7 @@ pub(crate) fn parse_check_cfg(dcx: DiagCtxtHandle<'_>, specs: Vec<String>) -> Ch
116116
let mut check_cfg = CheckCfg { exhaustive_names, exhaustive_values, ..CheckCfg::default() };
117117

118118
for s in specs {
119-
let psess = ParseSess::with_silent_emitter(
119+
let psess = ParseSess::with_fatal_emitter(
120120
vec![crate::DEFAULT_LOCALE_RESOURCE, rustc_parse::DEFAULT_LOCALE_RESOURCE],
121121
format!("this error occurred on the command line: `--check-cfg={s}`"),
122122
true,

compiler/rustc_session/src/parse.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use rustc_ast::attr::AttrIdGenerator;
88
use rustc_ast::node_id::NodeId;
99
use rustc_data_structures::fx::{FxHashMap, FxIndexMap, FxIndexSet};
1010
use rustc_data_structures::sync::{AppendOnlyVec, Lock};
11-
use rustc_errors::emitter::{HumanEmitter, SilentEmitter, stderr_destination};
11+
use rustc_errors::emitter::{FatalEmitter, HumanEmitter, stderr_destination};
1212
use rustc_errors::translation::Translator;
1313
use rustc_errors::{
1414
ColorConfig, Diag, DiagCtxt, DiagCtxtHandle, DiagMessage, EmissionGuarantee, MultiSpan,
@@ -275,7 +275,7 @@ impl ParseSess {
275275
}
276276
}
277277

278-
pub fn with_silent_emitter(
278+
pub fn with_fatal_emitter(
279279
locale_resources: Vec<&'static str>,
280280
fatal_note: String,
281281

@@ -285,7 +285,7 @@ impl ParseSess {
285285
let sm = Arc::new(SourceMap::new(FilePathMapping::empty()));
286286
let fatal_emitter =
287287
Box::new(HumanEmitter::new(stderr_destination(ColorConfig::Auto), translator));
288-
let dcx = DiagCtxt::new(Box::new(SilentEmitter {
288+
let dcx = DiagCtxt::new(Box::new(FatalEmitter {
289289
fatal_emitter,
290290
fatal_note: Some(fatal_note),
291291
emit_fatal_diagnostic,

src/tools/rustfmt/src/parse/session.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::sync::Arc;
33
use std::sync::atomic::{AtomicBool, Ordering};
44

55
use rustc_data_structures::sync::IntoDynSyncSend;
6-
use rustc_errors::emitter::{DynEmitter, Emitter, HumanEmitter, SilentEmitter, stderr_destination};
6+
use rustc_errors::emitter::{DynEmitter, Emitter, HumanEmitter, FatalEmitter, stderr_destination};
77
use rustc_errors::registry::Registry;
88
use rustc_errors::translation::Translator;
99
use rustc_errors::{ColorConfig, Diag, DiagCtxt, DiagInner, Level as DiagnosticLevel};
@@ -111,7 +111,7 @@ fn default_dcx(
111111
);
112112

113113
let emitter: Box<DynEmitter> = if !show_parse_errors {
114-
Box::new(SilentEmitter {
114+
Box::new(FatalEmitter {
115115
fatal_emitter: emitter,
116116
fatal_note: None,
117117
emit_fatal_diagnostic: false,

0 commit comments

Comments
 (0)