File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -268,18 +268,22 @@ impl<'tcx> Visitor<'tcx> for SideEffectVisit<'tcx> {
268
268
pat, init : Some ( init) , ..
269
269
} ) => {
270
270
self . visit_pat_expr ( pat, init, false ) ;
271
+ self . ret_vars . clear ( ) ;
271
272
} ,
272
273
StmtKind :: Item ( i) => {
273
274
let item = self . ty_ctx . hir ( ) . item ( i) ;
274
275
self . visit_item ( item) ;
276
+ self . ret_vars . clear ( ) ;
277
+ } ,
278
+ StmtKind :: Expr ( e) | StmtKind :: Semi ( e) => {
279
+ self . visit_expr ( e) ;
280
+ self . ret_vars . clear ( ) ;
275
281
} ,
276
- StmtKind :: Expr ( e) | StmtKind :: Semi ( e) => self . visit_expr ( e) ,
277
282
StmtKind :: Local ( _) => { } ,
278
283
}
279
284
}
280
285
281
286
fn visit_expr ( & mut self , ex : & ' tcx Expr < ' tcx > ) {
282
- debug_assert ! ( self . ret_vars. is_empty( ) ) ;
283
287
match ex. kind {
284
288
ExprKind :: Array ( exprs) | ExprKind :: Tup ( exprs) => {
285
289
self . ret_vars = exprs
You can’t perform that action at this time.
0 commit comments