1
Fork 0

Rollup merge of #92207 - tmiasko:delay-drop-elaboration-bug, r=jackh726

Delay remaining `span_bug`s 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.

Fixes #81708.
Fixes #91816.
This commit is contained in:
Matthias Krüger 2022-01-06 23:15:14 +01:00 committed by GitHub
commit 0604cf5fd8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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),
);
}
}