Rollup merge of #149020 - RalfJung:flush_delayed, r=nnethercote

flush_delayed: add note about stashed diagnostics

r? `@nnethercote`
Is `emit_stashed_diagnostics` the right advice to give? The other option seems to be to call `finish_diagnostics`. That's what I ended up doing (for now) in https://github.com/rust-lang/miri/pull/4702 because it best matches what happens during normal compilation.
This commit is contained in:
Guillaume Gomez 2025-11-18 14:14:39 +01:00 committed by GitHub
commit abf6d307ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1205,6 +1205,10 @@ impl<'a> DiagCtxtHandle<'a> {
std::mem::take(&mut self.inner.borrow_mut().fulfilled_expectations)
}
/// Trigger an ICE if there are any delayed bugs and no hard errors.
///
/// This will panic if there are any stashed diagnostics. You can call
/// `emit_stashed_diagnostics` to emit those before calling `flush_delayed`.
pub fn flush_delayed(&self) {
self.inner.borrow_mut().flush_delayed();
}