@@ -497,9 +497,6 @@ impl<'a, 'b, 'tcx> Visitor<'tcx> for TypeVerifier<'a, 'b, 'tcx> {
497
497
for ( block, block_data) in body. basic_blocks . iter_enumerated ( ) {
498
498
let mut location = Location { block, statement_index : 0 } ;
499
499
for stmt in & block_data. statements {
500
- if !stmt. source_info . span . is_dummy ( ) {
501
- self . last_span = stmt. source_info . span ;
502
- }
503
500
self . visit_statement ( stmt, location) ;
504
501
location. statement_index += 1 ;
505
502
}
@@ -895,11 +892,16 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
895
892
}
896
893
897
894
impl < ' a , ' tcx > Visitor < ' tcx > for TypeChecker < ' a , ' tcx > {
895
+ fn visit_span ( & mut self , span : Span ) {
896
+ if !span. is_dummy ( ) {
897
+ debug ! ( ?span) ;
898
+ self . last_span = span;
899
+ }
900
+ }
901
+
898
902
#[ instrument( skip( self , body) , level = "debug" ) ]
899
903
fn visit_body ( & mut self , body : & Body < ' tcx > ) {
900
904
debug_assert ! ( std:: ptr:: eq( self . body, body) ) ;
901
- self . last_span = body. span ;
902
- debug ! ( ?body. span) ;
903
905
904
906
for ( local, local_decl) in body. local_decls . iter_enumerated ( ) {
905
907
self . visit_local_decl ( local, local_decl) ;
@@ -908,9 +910,6 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
908
910
for ( block, block_data) in body. basic_blocks . iter_enumerated ( ) {
909
911
let mut location = Location { block, statement_index : 0 } ;
910
912
for stmt in & block_data. statements {
911
- if !stmt. source_info . span . is_dummy ( ) {
912
- self . last_span = stmt. source_info . span ;
913
- }
914
913
self . visit_statement ( stmt, location) ;
915
914
location. statement_index += 1 ;
916
915
}
@@ -2098,7 +2097,6 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
2098
2097
2099
2098
fn check_iscleanup ( & mut self , block_data : & BasicBlockData < ' tcx > ) {
2100
2099
let is_cleanup = block_data. is_cleanup ;
2101
- self . last_span = block_data. terminator ( ) . source_info . span ;
2102
2100
match block_data. terminator ( ) . kind {
2103
2101
TerminatorKind :: Goto { target } => {
2104
2102
self . assert_iscleanup ( block_data, target, is_cleanup)
0 commit comments