about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_mir_transform/src')
-rw-r--r--compiler/rustc_mir_transform/src/copy_prop.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_mir_transform/src/copy_prop.rs b/compiler/rustc_mir_transform/src/copy_prop.rs
index 13a18269585..bce307d368c 100644
--- a/compiler/rustc_mir_transform/src/copy_prop.rs
+++ b/compiler/rustc_mir_transform/src/copy_prop.rs
@@ -117,8 +117,10 @@ impl<'tcx> Visitor<'tcx> for SsaLocals {
                 self.assignments[local].insert(LocationExtended::Plain(loc));
                 self.assignment_order.push(local);
             }
-            PlaceContext::MutatingUse(_) => self.assignments[local] = Set1::Many,
-            // Immutable borrows and AddressOf are taken into account in `SsaLocals::new` by
+            // Anything can happen with raw pointers, so remove them.
+            PlaceContext::NonMutatingUse(NonMutatingUseContext::AddressOf)
+            | PlaceContext::MutatingUse(_) => self.assignments[local] = Set1::Many,
+            // Immutable borrows are taken into account in `SsaLocals::new` by
             // removing non-freeze locals.
             PlaceContext::NonMutatingUse(_) => {
                 let set = &mut self.assignments[local];