@@ -209,13 +209,6 @@ impl<'tcx> Visitor<'tcx> for SsaVisitor {
209209 match ctxt {
210210 PlaceContext :: MutatingUse ( MutatingUseContext :: Projection )
211211 | 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- }
219212 // Anything can happen with raw pointers, so remove them.
220213 // We do not verify that all uses of the borrow dominate the assignment to `local`,
221214 // so we have to remove them too.
@@ -252,6 +245,19 @@ impl<'tcx> Visitor<'tcx> for SsaVisitor {
252245 self . visit_local ( place. local , ctxt, loc) ;
253246 }
254247 }
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+ }
255261}
256262
257263#[ instrument( level = "trace" , skip( ssa, body) ) ]
0 commit comments