@@ -364,9 +364,6 @@ pub trait Visitor<'v>: Sized {
364364 /// All types are treated as ambiguous types for the purposes of hir visiting in
365365 /// order to ensure that visitors can handle infer vars without it being too error-prone.
366366 ///
367- /// See the doc comments on [`Ty`] for an explanation of what it means for a type to be
368- /// ambiguous.
369- ///
370367 /// The [`Visitor::visit_infer`] method should be overridden in order to handle infer vars.
371368 fn visit_ty ( & mut self , t : & ' v Ty < ' v , AmbigArg > ) -> Self :: Result {
372369 walk_ty ( self , t)
@@ -375,12 +372,9 @@ pub trait Visitor<'v>: Sized {
375372 /// All consts are treated as ambiguous consts for the purposes of hir visiting in
376373 /// order to ensure that visitors can handle infer vars without it being too error-prone.
377374 ///
378- /// See the doc comments on [`ConstArg`] for an explanation of what it means for a const to be
379- /// ambiguous.
380- ///
381375 /// The [`Visitor::visit_infer`] method should be overridden in order to handle infer vars.
382376 fn visit_const_arg ( & mut self , c : & ' v ConstArg < ' v , AmbigArg > ) -> Self :: Result {
383- walk_ambig_const_arg ( self , c)
377+ walk_const_arg ( self , c)
384378 }
385379
386380 #[ allow( unused_variables) ]
@@ -522,7 +516,7 @@ pub trait VisitorExt<'v>: Visitor<'v> {
522516 /// Named `visit_const_arg_unambig` instead of `visit_unambig_const_arg` to aid in
523517 /// discovery by IDes when `v.visit_const_arg` is written.
524518 fn visit_const_arg_unambig ( & mut self , c : & ' v ConstArg < ' v > ) -> Self :: Result {
525- walk_const_arg ( self , c)
519+ walk_unambig_const_arg ( self , c)
526520 }
527521}
528522impl < ' v , V : Visitor < ' v > > VisitorExt < ' v > for V { }
@@ -985,7 +979,6 @@ pub fn walk_unambig_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty<'v>) ->
985979 Some ( ambig_ty) => visitor. visit_ty ( ambig_ty) ,
986980 None => {
987981 let Ty { hir_id, span, kind : _ } = typ;
988- try_visit ! ( visitor. visit_id( * hir_id) ) ;
989982 visitor. visit_infer ( * hir_id, * span, InferKind :: Ty ( typ) )
990983 }
991984 }
@@ -1043,21 +1036,20 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty<'v, AmbigArg>) -
10431036 V :: Result :: output ( )
10441037}
10451038
1046- pub fn walk_const_arg < ' v , V : Visitor < ' v > > (
1039+ pub fn walk_unambig_const_arg < ' v , V : Visitor < ' v > > (
10471040 visitor : & mut V ,
10481041 const_arg : & ' v ConstArg < ' v > ,
10491042) -> V :: Result {
10501043 match const_arg. try_as_ambig_ct ( ) {
10511044 Some ( ambig_ct) => visitor. visit_const_arg ( ambig_ct) ,
10521045 None => {
10531046 let ConstArg { hir_id, kind : _ } = const_arg;
1054- try_visit ! ( visitor. visit_id( * hir_id) ) ;
10551047 visitor. visit_infer ( * hir_id, const_arg. span ( ) , InferKind :: Const ( const_arg) )
10561048 }
10571049 }
10581050}
10591051
1060- pub fn walk_ambig_const_arg < ' v , V : Visitor < ' v > > (
1052+ pub fn walk_const_arg < ' v , V : Visitor < ' v > > (
10611053 visitor : & mut V ,
10621054 const_arg : & ' v ConstArg < ' v , AmbigArg > ,
10631055) -> V :: Result {
0 commit comments