Skip to content

Commit 3268f2e

Browse files
committed
Only check that StorageLive dominates address-taking.
1 parent 0bd9bd6 commit 3268f2e

File tree

1 file changed

+1
-4
lines changed
  • compiler/rustc_mir_transform/src

1 file changed

+1
-4
lines changed

compiler/rustc_mir_transform/src/ssa.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//!
88
//! We say a local has a stable address if its address has SSA-like properties:
99
//! 1/ It has a single `StorageLive` statement, or none at all (always-live);
10-
//! 2/ All its uses dominate this `StorageLive` statement.
10+
//! 2/ This `StorageLive` statement dominates all statements that take this local's address.
1111
//!
1212
//! We do not discard borrowed locals from this analysis, as we cannot take their address' address.
1313
@@ -247,7 +247,6 @@ impl<'tcx> Visitor<'tcx> for SsaVisitor {
247247
// Only record if SSA-like, to avoid growing the vector needlessly.
248248
self.assignment_order.push(local);
249249
}
250-
self.dominators.check_dominates(&mut self.storage_live[local], loc);
251250
}
252251
// Anything can happen with raw pointers, so remove them.
253252
// We do not verify that all uses of the borrow dominate the assignment to `local`,
@@ -264,7 +263,6 @@ impl<'tcx> Visitor<'tcx> for SsaVisitor {
264263
}
265264
PlaceContext::NonMutatingUse(_) => {
266265
self.dominators.check_dominates(&mut self.assignments[local], loc);
267-
self.dominators.check_dominates(&mut self.storage_live[local], loc);
268266
self.direct_uses[local] += 1;
269267
}
270268
PlaceContext::NonUse(NonUseContext::StorageLive) => {
@@ -283,7 +281,6 @@ impl<'tcx> Visitor<'tcx> for SsaVisitor {
283281

284282
self.visit_projection(place.as_ref(), new_ctxt, loc);
285283
self.dominators.check_dominates(&mut self.assignments[place.local], loc);
286-
self.dominators.check_dominates(&mut self.storage_live[place.local], loc);
287284
}
288285
return;
289286
} else {

0 commit comments

Comments
 (0)