1
Fork 0

Delay remaining span_bugs in drop elaboration

This follows changes from #67967 and converts remaining `span_bug`s into
delayed bugs, since for const items drop elaboration might be executed
on a MIR which failed borrowck.
This commit is contained in:
Tomasz Miąsko 2021-12-22 00:00:00 +00:00
parent e100ec5bc7
commit 0db192a48c
3 changed files with 89 additions and 8 deletions

View file

@ -316,12 +316,12 @@ impl<'b, 'tcx> ElaborateDropsCtxt<'b, 'tcx> {
LookupResult::Parent(Some(parent)) => {
let (_maybe_live, maybe_dead) = self.init_data.maybe_live_dead(parent);
if maybe_dead {
span_bug!(
self.tcx.sess.delay_span_bug(
terminator.source_info.span,
"drop of untracked, uninitialized value {:?}, place {:?} ({:?})",
bb,
place,
path
&format!(
"drop of untracked, uninitialized value {:?}, place {:?} ({:?})",
bb, place, path,
),
);
}
continue;
@ -368,10 +368,9 @@ impl<'b, 'tcx> ElaborateDropsCtxt<'b, 'tcx> {
bb,
),
LookupResult::Parent(..) => {
span_bug!(
self.tcx.sess.delay_span_bug(
terminator.source_info.span,
"drop of untracked value {:?}",
bb
&format!("drop of untracked value {:?}", bb),
);
}
}