@@ -36,6 +36,7 @@ use syntax_pos::Span;
36
36
37
37
use std:: collections:: hash_map:: Entry ;
38
38
use std:: fmt;
39
+ use std:: usize;
39
40
40
41
use super :: promote_consts:: { self , Candidate , TempState } ;
41
42
@@ -393,8 +394,8 @@ impl<'a, 'tcx> Qualifier<'a, 'tcx, 'tcx> {
393
394
for index in 0 ..mir. var_decls . len ( ) {
394
395
if !self . const_fn_arg_vars . contains ( index) {
395
396
self . assign ( & Lvalue :: Var ( Var :: new ( index) ) , Location {
396
- block : BasicBlock :: new ( 0 ) ,
397
- statement_index : 0
397
+ block : bb ,
398
+ statement_index : usize :: MAX ,
398
399
} ) ;
399
400
}
400
401
}
@@ -859,7 +860,17 @@ impl<'a, 'tcx> Visitor<'tcx> for Qualifier<'a, 'tcx, 'tcx> {
859
860
}
860
861
861
862
fn visit_statement ( & mut self , bb : BasicBlock , statement : & Statement < ' tcx > , location : Location ) {
862
- self . nest ( |this| this. super_statement ( bb, statement, location) ) ;
863
+ self . nest ( |this| {
864
+ this. visit_source_info ( & statement. source_info ) ;
865
+ match statement. kind {
866
+ StatementKind :: Assign ( ref lvalue, ref rvalue) => {
867
+ this. visit_assign ( bb, lvalue, rvalue, location) ;
868
+ }
869
+ StatementKind :: SetDiscriminant { .. } |
870
+ StatementKind :: StorageLive ( _) |
871
+ StatementKind :: StorageDead ( _) => { }
872
+ }
873
+ } ) ;
863
874
}
864
875
865
876
fn visit_terminator ( & mut self ,
0 commit comments