@@ -211,7 +211,7 @@ macro_rules! make_mir_visitor {
211211
212212 fn visit_ty( & mut self ,
213213 ty: & $( $mutability) * Ty <' tcx>,
214- _: PositionalInfo ) {
214+ _: Lookup ) {
215215 self . super_ty( ty) ;
216216 }
217217
@@ -269,7 +269,11 @@ macro_rules! make_mir_visitor {
269269 self . visit_visibility_scope_data( scope) ;
270270 }
271271
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) ;
273277
274278 for local_decl in & $( $mutability) * mir. local_decls {
275279 self . visit_local_decl( local_decl) ;
@@ -388,7 +392,7 @@ macro_rules! make_mir_visitor {
388392 ref values,
389393 ref targets } => {
390394 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) ) ;
392396 for value in & values[ ..] {
393397 self . visit_const_int( value, source_location) ;
394398 }
@@ -492,7 +496,7 @@ macro_rules! make_mir_visitor {
492496 ref $( $mutability) * operand,
493497 ref $( $mutability) * ty) => {
494498 self . visit_operand( operand, location) ;
495- self . visit_ty( ty, PositionalInfo :: Location ( location) ) ;
499+ self . visit_ty( ty, Lookup :: Loc ( location) ) ;
496500 }
497501
498502 Rvalue :: BinaryOp ( _bin_op,
@@ -514,15 +518,15 @@ macro_rules! make_mir_visitor {
514518 }
515519
516520 Rvalue :: NullaryOp ( _op, ref $( $mutability) * ty) => {
517- self . visit_ty( ty, PositionalInfo :: Location ( location) ) ;
521+ self . visit_ty( ty, Lookup :: Loc ( location) ) ;
518522 }
519523
520524 Rvalue :: Aggregate ( ref $( $mutability) * kind,
521525 ref $( $mutability) * operands) => {
522526 let kind = & $( $mutability) * * * kind;
523527 match * kind {
524528 AggregateKind :: Array ( ref $( $mutability) * ty) => {
525- self . visit_ty( ty, PositionalInfo :: Location ( location) ) ;
529+ self . visit_ty( ty, Lookup :: Loc ( location) ) ;
526530 }
527531 AggregateKind :: Tuple => {
528532 }
@@ -584,7 +588,7 @@ macro_rules! make_mir_visitor {
584588 ref $( $mutability) * ty,
585589 } = * static_;
586590 self . visit_def_id( def_id, location) ;
587- self . visit_ty( ty, PositionalInfo :: Location ( location) ) ;
591+ self . visit_ty( ty, Lookup :: Loc ( location) ) ;
588592 }
589593
590594 fn super_projection( & mut self ,
@@ -614,7 +618,7 @@ macro_rules! make_mir_visitor {
614618 ProjectionElem :: Subslice { from: _, to: _ } => {
615619 }
616620 ProjectionElem :: Field ( _field, ref $( $mutability) * ty) => {
617- self . visit_ty( ty, PositionalInfo :: Location ( location) ) ;
621+ self . visit_ty( ty, Lookup :: Loc ( location) ) ;
618622 }
619623 ProjectionElem :: Index ( ref $( $mutability) * operand) => {
620624 self . visit_operand( operand, location) ;
@@ -638,7 +642,7 @@ macro_rules! make_mir_visitor {
638642 is_user_variable: _,
639643 } = * local_decl;
640644
641- self . visit_ty( ty, PositionalInfo :: SourceInfo ( * source_info) ) ;
645+ self . visit_ty( ty, Lookup :: Src ( * source_info) ) ;
642646 self . visit_source_info( source_info) ;
643647 }
644648
@@ -661,7 +665,7 @@ macro_rules! make_mir_visitor {
661665 } = * constant;
662666
663667 self . visit_span( span) ;
664- self . visit_ty( ty, PositionalInfo :: Location ( location) ) ;
668+ self . visit_ty( ty, Lookup :: Loc ( location) ) ;
665669 self . visit_literal( literal, location) ;
666670 }
667671
@@ -737,10 +741,9 @@ macro_rules! make_mir_visitor {
737741make_mir_visitor ! ( Visitor , ) ;
738742make_mir_visitor ! ( MutVisitor , mut ) ;
739743
740- pub enum PositionalInfo {
741- Location ( Location ) ,
742- SourceInfo ( SourceInfo ) ,
743- Span ( Span ) ,
744+ pub enum Lookup {
745+ Loc ( Location ) ,
746+ Src ( SourceInfo ) ,
744747}
745748
746749#[ derive( Copy , Clone , Debug , PartialEq , Eq ) ]
0 commit comments