Add DiagCtxt::delayed_bug
.
We have `span_delayed_bug` and often pass it a `DUMMY_SP`. This commit adds `delayed_bug`, which matches pairs like `err`/`span_err` and `warn`/`span_warn`.
This commit is contained in:
parent
3c4f1d85af
commit
2ea7a37e11
27 changed files with 103 additions and 146 deletions
|
@ -31,7 +31,7 @@ pub fn check_crate(tcx: TyCtxt<'_>) {
|
|||
|
||||
if !errors.is_empty() {
|
||||
let message = errors.iter().fold(String::new(), |s1, s2| s1 + "\n" + s2);
|
||||
tcx.dcx().span_delayed_bug(rustc_span::DUMMY_SP, message);
|
||||
tcx.dcx().delayed_bug(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -98,7 +98,6 @@ use rustc_middle::query::Providers;
|
|||
use rustc_middle::ty::{self, RootVariableMinCaptureList, Ty, TyCtxt};
|
||||
use rustc_session::lint;
|
||||
use rustc_span::symbol::{kw, sym, Symbol};
|
||||
use rustc_span::DUMMY_SP;
|
||||
use rustc_span::{BytePos, Span};
|
||||
|
||||
use std::io;
|
||||
|
@ -560,7 +559,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
|
|||
match self.successors[ln] {
|
||||
Some(successor) => self.assigned_on_entry(successor, var),
|
||||
None => {
|
||||
self.ir.tcx.dcx().span_delayed_bug(DUMMY_SP, "no successor");
|
||||
self.ir.tcx.dcx().delayed_bug("no successor");
|
||||
true
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue