Replace ParseSess::set_dcx with DiagCtxt::set_emitter

Replacing the error emitter doesn't accidentally clear the error count.
This commit is contained in:
bjorn3 2025-02-02 16:06:16 +00:00
parent 6556147d15
commit 6a566ee092
3 changed files with 8 additions and 8 deletions

View file

@ -712,6 +712,10 @@ impl DiagCtxt {
inner.emitter = new_emitter;
}
pub fn set_emitter(&self, emitter: Box<dyn Emitter + DynSend>) {
self.inner.borrow_mut().emitter = emitter;
}
/// Translate `message` eagerly with `args` to `SubdiagMessage::Eager`.
pub fn eagerly_translate<'a>(
&self,