1
Fork 0

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:
Matthias Krüger 2025-04-14 18:15:32 +02:00 committed by GitHub
commit 143f5d7696
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 19 additions and 25 deletions

View file

@ -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(

View file

@ -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();
}