@@ -209,13 +209,6 @@ impl<'tcx> Visitor<'tcx> for SsaVisitor {
209
209
match ctxt {
210
210
PlaceContext :: MutatingUse ( MutatingUseContext :: Projection )
211
211
| PlaceContext :: NonMutatingUse ( NonMutatingUseContext :: Projection ) => bug ! ( ) ,
212
- PlaceContext :: MutatingUse ( MutatingUseContext :: Store ) => {
213
- self . assignments [ local] . insert ( LocationExtended :: Plain ( loc) ) ;
214
- if let Set1 :: One ( _) = self . assignments [ local] {
215
- // Only record if SSA-like, to avoid growing the vector needlessly.
216
- self . assignment_order . push ( local) ;
217
- }
218
- }
219
212
// Anything can happen with raw pointers, so remove them.
220
213
// We do not verify that all uses of the borrow dominate the assignment to `local`,
221
214
// so we have to remove them too.
@@ -252,6 +245,19 @@ impl<'tcx> Visitor<'tcx> for SsaVisitor {
252
245
self . visit_local ( place. local , ctxt, loc) ;
253
246
}
254
247
}
248
+
249
+ fn visit_assign ( & mut self , place : & Place < ' tcx > , rvalue : & Rvalue < ' tcx > , loc : Location ) {
250
+ if let Some ( local) = place. as_local ( ) {
251
+ self . assignments [ local] . insert ( LocationExtended :: Plain ( loc) ) ;
252
+ if let Set1 :: One ( _) = self . assignments [ local] {
253
+ // Only record if SSA-like, to avoid growing the vector needlessly.
254
+ self . assignment_order . push ( local) ;
255
+ }
256
+ } else {
257
+ self . visit_place ( place, PlaceContext :: MutatingUse ( MutatingUseContext :: Store ) , loc) ;
258
+ }
259
+ self . visit_rvalue ( rvalue, loc) ;
260
+ }
255
261
}
256
262
257
263
#[ instrument( level = "trace" , skip( ssa, body) ) ]
0 commit comments