@@ -211,7 +211,7 @@ macro_rules! make_mir_visitor {
211
211
212
212
fn visit_ty( & mut self ,
213
213
ty: & $( $mutability) * Ty <' tcx>,
214
- _: PositionalInfo ) {
214
+ _: Lookup ) {
215
215
self . super_ty( ty) ;
216
216
}
217
217
@@ -269,7 +269,11 @@ macro_rules! make_mir_visitor {
269
269
self . visit_visibility_scope_data( scope) ;
270
270
}
271
271
272
- self . visit_ty( & $( $mutability) * mir. return_ty, PositionalInfo :: Span ( mir. span) ) ;
272
+ let lookup = Lookup :: Src ( SourceInfo {
273
+ span: mir. span,
274
+ scope: ARGUMENT_VISIBILITY_SCOPE ,
275
+ } ) ;
276
+ self . visit_ty( & $( $mutability) * mir. return_ty, lookup) ;
273
277
274
278
for local_decl in & $( $mutability) * mir. local_decls {
275
279
self . visit_local_decl( local_decl) ;
@@ -388,7 +392,7 @@ macro_rules! make_mir_visitor {
388
392
ref values,
389
393
ref targets } => {
390
394
self . visit_operand( discr, source_location) ;
391
- self . visit_ty( switch_ty, PositionalInfo :: Location ( source_location) ) ;
395
+ self . visit_ty( switch_ty, Lookup :: Loc ( source_location) ) ;
392
396
for value in & values[ ..] {
393
397
self . visit_const_int( value, source_location) ;
394
398
}
@@ -492,7 +496,7 @@ macro_rules! make_mir_visitor {
492
496
ref $( $mutability) * operand,
493
497
ref $( $mutability) * ty) => {
494
498
self . visit_operand( operand, location) ;
495
- self . visit_ty( ty, PositionalInfo :: Location ( location) ) ;
499
+ self . visit_ty( ty, Lookup :: Loc ( location) ) ;
496
500
}
497
501
498
502
Rvalue :: BinaryOp ( _bin_op,
@@ -514,15 +518,15 @@ macro_rules! make_mir_visitor {
514
518
}
515
519
516
520
Rvalue :: NullaryOp ( _op, ref $( $mutability) * ty) => {
517
- self . visit_ty( ty, PositionalInfo :: Location ( location) ) ;
521
+ self . visit_ty( ty, Lookup :: Loc ( location) ) ;
518
522
}
519
523
520
524
Rvalue :: Aggregate ( ref $( $mutability) * kind,
521
525
ref $( $mutability) * operands) => {
522
526
let kind = & $( $mutability) * * * kind;
523
527
match * kind {
524
528
AggregateKind :: Array ( ref $( $mutability) * ty) => {
525
- self . visit_ty( ty, PositionalInfo :: Location ( location) ) ;
529
+ self . visit_ty( ty, Lookup :: Loc ( location) ) ;
526
530
}
527
531
AggregateKind :: Tuple => {
528
532
}
@@ -584,7 +588,7 @@ macro_rules! make_mir_visitor {
584
588
ref $( $mutability) * ty,
585
589
} = * static_;
586
590
self . visit_def_id( def_id, location) ;
587
- self . visit_ty( ty, PositionalInfo :: Location ( location) ) ;
591
+ self . visit_ty( ty, Lookup :: Loc ( location) ) ;
588
592
}
589
593
590
594
fn super_projection( & mut self ,
@@ -614,7 +618,7 @@ macro_rules! make_mir_visitor {
614
618
ProjectionElem :: Subslice { from: _, to: _ } => {
615
619
}
616
620
ProjectionElem :: Field ( _field, ref $( $mutability) * ty) => {
617
- self . visit_ty( ty, PositionalInfo :: Location ( location) ) ;
621
+ self . visit_ty( ty, Lookup :: Loc ( location) ) ;
618
622
}
619
623
ProjectionElem :: Index ( ref $( $mutability) * operand) => {
620
624
self . visit_operand( operand, location) ;
@@ -638,7 +642,7 @@ macro_rules! make_mir_visitor {
638
642
is_user_variable: _,
639
643
} = * local_decl;
640
644
641
- self . visit_ty( ty, PositionalInfo :: SourceInfo ( * source_info) ) ;
645
+ self . visit_ty( ty, Lookup :: Src ( * source_info) ) ;
642
646
self . visit_source_info( source_info) ;
643
647
}
644
648
@@ -661,7 +665,7 @@ macro_rules! make_mir_visitor {
661
665
} = * constant;
662
666
663
667
self . visit_span( span) ;
664
- self . visit_ty( ty, PositionalInfo :: Location ( location) ) ;
668
+ self . visit_ty( ty, Lookup :: Loc ( location) ) ;
665
669
self . visit_literal( literal, location) ;
666
670
}
667
671
@@ -737,10 +741,9 @@ macro_rules! make_mir_visitor {
737
741
make_mir_visitor ! ( Visitor , ) ;
738
742
make_mir_visitor ! ( MutVisitor , mut ) ;
739
743
740
- pub enum PositionalInfo {
741
- Location ( Location ) ,
742
- SourceInfo ( SourceInfo ) ,
743
- Span ( Span ) ,
744
+ pub enum Lookup {
745
+ Loc ( Location ) ,
746
+ Src ( SourceInfo ) ,
744
747
}
745
748
746
749
#[ derive( Copy , Clone , Debug , PartialEq , Eq ) ]
0 commit comments