Skip to content

Commit 2c6bbcf

Browse files
committed
Replace ParseSess::set_dcx with DiagCtxt::set_emitter
Replacing the error emitter doesn't accidentally clear the error count.
1 parent 6556147 commit 2c6bbcf

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

compiler/rustc_errors/src/lib.rs

+4
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,10 @@ impl DiagCtxt {
712712
inner.emitter = new_emitter;
713713
}
714714

715+
pub fn set_emitter(&self, emitter: Box<dyn Emitter + DynSend>) {
716+
self.inner.borrow_mut().emitter = emitter;
717+
}
718+
715719
/// Translate `message` eagerly with `args` to `SubdiagMessage::Eager`.
716720
pub fn eagerly_translate<'a>(
717721
&self,

compiler/rustc_session/src/parse.rs

-4
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,4 @@ impl ParseSess {
337337
pub fn dcx(&self) -> DiagCtxtHandle<'_> {
338338
self.dcx.handle()
339339
}
340-
341-
pub fn set_dcx(&mut self, dcx: DiagCtxt) {
342-
self.dcx = dcx;
343-
}
344340
}

0 commit comments

Comments
 (0)