@@ -364,9 +364,6 @@ pub trait Visitor<'v>: Sized {
364
364
/// All types are treated as ambiguous types for the purposes of hir visiting in
365
365
/// order to ensure that visitors can handle infer vars without it being too error-prone.
366
366
///
367
- /// See the doc comments on [`Ty`] for an explanation of what it means for a type to be
368
- /// ambiguous.
369
- ///
370
367
/// The [`Visitor::visit_infer`] method should be overridden in order to handle infer vars.
371
368
fn visit_ty ( & mut self , t : & ' v Ty < ' v , AmbigArg > ) -> Self :: Result {
372
369
walk_ty ( self , t)
@@ -375,12 +372,9 @@ pub trait Visitor<'v>: Sized {
375
372
/// All consts are treated as ambiguous consts for the purposes of hir visiting in
376
373
/// order to ensure that visitors can handle infer vars without it being too error-prone.
377
374
///
378
- /// See the doc comments on [`ConstArg`] for an explanation of what it means for a const to be
379
- /// ambiguous.
380
- ///
381
375
/// The [`Visitor::visit_infer`] method should be overridden in order to handle infer vars.
382
376
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)
384
378
}
385
379
386
380
#[ allow( unused_variables) ]
@@ -522,7 +516,7 @@ pub trait VisitorExt<'v>: Visitor<'v> {
522
516
/// Named `visit_const_arg_unambig` instead of `visit_unambig_const_arg` to aid in
523
517
/// discovery by IDes when `v.visit_const_arg` is written.
524
518
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)
526
520
}
527
521
}
528
522
impl < ' 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>) ->
985
979
Some ( ambig_ty) => visitor. visit_ty ( ambig_ty) ,
986
980
None => {
987
981
let Ty { hir_id, span, kind : _ } = typ;
988
- try_visit ! ( visitor. visit_id( * hir_id) ) ;
989
982
visitor. visit_infer ( * hir_id, * span, InferKind :: Ty ( typ) )
990
983
}
991
984
}
@@ -1043,21 +1036,20 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty<'v, AmbigArg>) -
1043
1036
V :: Result :: output ( )
1044
1037
}
1045
1038
1046
- pub fn walk_const_arg < ' v , V : Visitor < ' v > > (
1039
+ pub fn walk_unambig_const_arg < ' v , V : Visitor < ' v > > (
1047
1040
visitor : & mut V ,
1048
1041
const_arg : & ' v ConstArg < ' v > ,
1049
1042
) -> V :: Result {
1050
1043
match const_arg. try_as_ambig_ct ( ) {
1051
1044
Some ( ambig_ct) => visitor. visit_const_arg ( ambig_ct) ,
1052
1045
None => {
1053
1046
let ConstArg { hir_id, kind : _ } = const_arg;
1054
- try_visit ! ( visitor. visit_id( * hir_id) ) ;
1055
1047
visitor. visit_infer ( * hir_id, const_arg. span ( ) , InferKind :: Const ( const_arg) )
1056
1048
}
1057
1049
}
1058
1050
}
1059
1051
1060
- pub fn walk_ambig_const_arg < ' v , V : Visitor < ' v > > (
1052
+ pub fn walk_const_arg < ' v , V : Visitor < ' v > > (
1061
1053
visitor : & mut V ,
1062
1054
const_arg : & ' v ConstArg < ' v , AmbigArg > ,
1063
1055
) -> V :: Result {
0 commit comments