mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Rename SilentEmitter::fatal_handler
as SilentEmitter::fatal_dcx
.
This commit is contained in:
parent
55bafab566
commit
20cb12ede1
@ -553,10 +553,10 @@ impl Emitter for EmitterWriter {
|
||||
}
|
||||
|
||||
/// An emitter that does nothing when emitting a non-fatal diagnostic.
|
||||
/// Fatal diagnostics are forwarded to `fatal_handler` to avoid silent
|
||||
/// Fatal diagnostics are forwarded to `fatal_dcx` to avoid silent
|
||||
/// failures of rustc, as witnessed e.g. in issue #89358.
|
||||
pub struct SilentEmitter {
|
||||
pub fatal_handler: DiagCtxt,
|
||||
pub fatal_dcx: DiagCtxt,
|
||||
pub fatal_note: Option<String>,
|
||||
}
|
||||
|
||||
@ -581,7 +581,7 @@ impl Emitter for SilentEmitter {
|
||||
if let Some(ref note) = self.fatal_note {
|
||||
d.note(note.clone());
|
||||
}
|
||||
self.fatal_handler.emit_diagnostic(d);
|
||||
self.fatal_dcx.emit_diagnostic(d);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -255,8 +255,8 @@ impl ParseSess {
|
||||
pub fn with_silent_emitter(fatal_note: Option<String>) -> Self {
|
||||
let fallback_bundle = fallback_fluent_bundle(Vec::new(), false);
|
||||
let sm = Lrc::new(SourceMap::new(FilePathMapping::empty()));
|
||||
let fatal_handler = DiagCtxt::with_tty_emitter(None, fallback_bundle).disable_warnings();
|
||||
let handler = DiagCtxt::with_emitter(Box::new(SilentEmitter { fatal_handler, fatal_note }))
|
||||
let fatal_dcx = DiagCtxt::with_tty_emitter(None, fallback_bundle).disable_warnings();
|
||||
let handler = DiagCtxt::with_emitter(Box::new(SilentEmitter { fatal_dcx, fatal_note }))
|
||||
.disable_warnings();
|
||||
ParseSess::with_dcx(handler, sm)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user