Rename DiagCtxt::with_emitter as DiagCtxt::new.

Because it's now the only constructor.
This commit is contained in:
Nicholas Nethercote 2024-02-29 11:50:32 +11:00
parent 4026fd735c
commit 0811e8f877

View File

@ -154,7 +154,7 @@ fn default_dcx(
);
Box::new(HumanEmitter::stderr(emit_color, fallback_bundle).sm(Some(source_map.clone())))
};
DiagCtxt::with_emitter(Box::new(SilentOnIgnoredFilesEmitter {
DiagCtxt::new(Box::new(SilentOnIgnoredFilesEmitter {
has_non_ignorable_parser_errors: false,
source_map,
emitter,
@ -235,7 +235,7 @@ impl ParseSess {
}
pub(crate) fn set_silent_emitter(&mut self) {
self.parse_sess.dcx = DiagCtxt::with_emitter(silent_emitter());
self.parse_sess.dcx = DiagCtxt::new(silent_emitter());
}
pub(crate) fn span_to_filename(&self, span: Span) -> FileName {