Rollup merge of #139767 - compiler-errors:www, r=oli-obk
Visit place in `BackwardIncompatibleDropHint` statement Remove a weird hack from the `LocalUpdater` where we were manually visiting the place stored in a `StatementKind::BackwardIncompatibleDropHint` because the MIR visitor impls weren't doing so. Also, clean up `BackwardIncompatibleDropHint`s in `CleanupPostBorrowck`, since they're not needed for runtime MIR.
This commit is contained in:
commit
143f5d7696
8 changed files with 19 additions and 25 deletions
|
@ -35,7 +35,8 @@ impl<'tcx> crate::MirPass<'tcx> for CleanupPostBorrowck {
|
|||
// MIR building, and are not needed after InstrumentCoverage.
|
||||
CoverageKind::BlockMarker { .. } | CoverageKind::SpanMarker { .. },
|
||||
)
|
||||
| StatementKind::FakeRead(..) => statement.make_nop(),
|
||||
| StatementKind::FakeRead(..)
|
||||
| StatementKind::BackwardIncompatibleDropHint { .. } => statement.make_nop(),
|
||||
StatementKind::Assign(box (
|
||||
_,
|
||||
Rvalue::Cast(
|
||||
|
|
|
@ -597,20 +597,6 @@ impl<'tcx> MutVisitor<'tcx> for LocalUpdater<'tcx> {
|
|||
self.tcx
|
||||
}
|
||||
|
||||
fn visit_statement(&mut self, statement: &mut Statement<'tcx>, location: Location) {
|
||||
if let StatementKind::BackwardIncompatibleDropHint { place, reason: _ } =
|
||||
&mut statement.kind
|
||||
{
|
||||
self.visit_local(
|
||||
&mut place.local,
|
||||
PlaceContext::MutatingUse(MutatingUseContext::Store),
|
||||
location,
|
||||
);
|
||||
} else {
|
||||
self.super_statement(statement, location);
|
||||
}
|
||||
}
|
||||
|
||||
fn visit_local(&mut self, l: &mut Local, _: PlaceContext, _: Location) {
|
||||
*l = self.map[*l].unwrap();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue