@@ -88,32 +88,28 @@ macro_rules! make_mir_visitor {
8888 }
8989
9090 fn visit_statement( & mut self ,
91- block: BasicBlock ,
9291 statement: & $( $mutability) ? Statement <' tcx>,
9392 location: Location ) {
94- self . super_statement( block , statement, location) ;
93+ self . super_statement( statement, location) ;
9594 }
9695
9796 fn visit_assign( & mut self ,
98- block: BasicBlock ,
9997 place: & $( $mutability) ? Place <' tcx>,
10098 rvalue: & $( $mutability) ? Rvalue <' tcx>,
10199 location: Location ) {
102- self . super_assign( block , place, rvalue, location) ;
100+ self . super_assign( place, rvalue, location) ;
103101 }
104102
105103 fn visit_terminator( & mut self ,
106- block: BasicBlock ,
107104 terminator: & $( $mutability) ? Terminator <' tcx>,
108105 location: Location ) {
109- self . super_terminator( block , terminator, location) ;
106+ self . super_terminator( terminator, location) ;
110107 }
111108
112109 fn visit_terminator_kind( & mut self ,
113- block: BasicBlock ,
114110 kind: & $( $mutability) ? TerminatorKind <' tcx>,
115111 location: Location ) {
116- self . super_terminator_kind( block , kind, location) ;
112+ self . super_terminator_kind( kind, location) ;
117113 }
118114
119115 fn visit_assert_message( & mut self ,
@@ -327,13 +323,13 @@ macro_rules! make_mir_visitor {
327323 let mut index = 0 ;
328324 for statement in statements {
329325 let location = Location { block: block, statement_index: index } ;
330- self . visit_statement( block , statement, location) ;
326+ self . visit_statement( statement, location) ;
331327 index += 1 ;
332328 }
333329
334330 if let Some ( terminator) = terminator {
335331 let location = Location { block: block, statement_index: index } ;
336- self . visit_terminator( block , terminator, location) ;
332+ self . visit_terminator( terminator, location) ;
337333 }
338334 }
339335
@@ -350,7 +346,6 @@ macro_rules! make_mir_visitor {
350346 }
351347
352348 fn super_statement( & mut self ,
353- block: BasicBlock ,
354349 statement: & $( $mutability) ? Statement <' tcx>,
355350 location: Location ) {
356351 let Statement {
@@ -361,7 +356,7 @@ macro_rules! make_mir_visitor {
361356 self . visit_source_info( source_info) ;
362357 match kind {
363358 StatementKind :: Assign ( place, rvalue) => {
364- self . visit_assign( block , place, rvalue, location) ;
359+ self . visit_assign( place, rvalue, location) ;
365360 }
366361 StatementKind :: FakeRead ( _, place) => {
367362 self . visit_place(
@@ -415,7 +410,6 @@ macro_rules! make_mir_visitor {
415410 }
416411
417412 fn super_assign( & mut self ,
418- _block: BasicBlock ,
419413 place: & $( $mutability) ? Place <' tcx>,
420414 rvalue: & $( $mutability) ? Rvalue <' tcx>,
421415 location: Location ) {
@@ -428,19 +422,18 @@ macro_rules! make_mir_visitor {
428422 }
429423
430424 fn super_terminator( & mut self ,
431- block: BasicBlock ,
432425 terminator: & $( $mutability) ? Terminator <' tcx>,
433426 location: Location ) {
434427 let Terminator { source_info, kind } = terminator;
435428
436429 self . visit_source_info( source_info) ;
437- self . visit_terminator_kind( block , kind, location) ;
430+ self . visit_terminator_kind( kind, location) ;
438431 }
439432
440433 fn super_terminator_kind( & mut self ,
441- block: BasicBlock ,
442434 kind: & $( $mutability) ? TerminatorKind <' tcx>,
443435 source_location: Location ) {
436+ let block = source_location. block;
444437 match kind {
445438 TerminatorKind :: Goto { target } => {
446439 self . visit_branch( block, * target) ;
@@ -890,12 +883,12 @@ macro_rules! make_mir_visitor {
890883 let basic_block = & $( $mutability) ? mir[ location. block] ;
891884 if basic_block. statements. len( ) == location. statement_index {
892885 if let Some ( ref $( $mutability) ? terminator) = basic_block. terminator {
893- self . visit_terminator( location . block , terminator, location)
886+ self . visit_terminator( terminator, location)
894887 }
895888 } else {
896889 let statement = & $( $mutability) ?
897890 basic_block. statements[ location. statement_index] ;
898- self . visit_statement( location . block , statement, location)
891+ self . visit_statement( statement, location)
899892 }
900893 }
901894 }
@@ -912,21 +905,21 @@ pub trait MirVisitable<'tcx> {
912905impl < ' tcx > MirVisitable < ' tcx > for Statement < ' tcx > {
913906 fn apply ( & self , location : Location , visitor : & mut dyn Visitor < ' tcx > )
914907 {
915- visitor. visit_statement ( location . block , self , location)
908+ visitor. visit_statement ( self , location)
916909 }
917910}
918911
919912impl < ' tcx > MirVisitable < ' tcx > for Terminator < ' tcx > {
920913 fn apply ( & self , location : Location , visitor : & mut dyn Visitor < ' tcx > )
921914 {
922- visitor. visit_terminator ( location . block , self , location)
915+ visitor. visit_terminator ( self , location)
923916 }
924917}
925918
926919impl < ' tcx > MirVisitable < ' tcx > for Option < Terminator < ' tcx > > {
927920 fn apply ( & self , location : Location , visitor : & mut dyn Visitor < ' tcx > )
928921 {
929- visitor. visit_terminator ( location . block , self . as_ref ( ) . unwrap ( ) , location)
922+ visitor. visit_terminator ( self . as_ref ( ) . unwrap ( ) , location)
930923 }
931924}
932925
0 commit comments