Skip to content

Commit 0c92210

Browse files
committed
visit_shared_ty_const to visit_infer
1 parent f97e9f8 commit 0c92210

File tree

13 files changed

+16
-27
lines changed

13 files changed

+16
-27
lines changed

compiler/rustc_ast_lowering/src/index.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
300300
});
301301
}
302302

303-
fn visit_shared_ty_const(
303+
fn visit_infer(
304304
&mut self,
305305
inf_id: HirId,
306306
inf_span: Span,

compiler/rustc_hir/src/intravisit.rs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -361,12 +361,7 @@ pub trait Visitor<'v>: Sized {
361361
}
362362

363363
#[allow(unused_variables)]
364-
fn visit_shared_ty_const(
365-
&mut self,
366-
inf_id: HirId,
367-
inf_span: Span,
368-
kind: InferKind<'v>,
369-
) -> Self::Result {
364+
fn visit_infer(&mut self, inf_id: HirId, inf_span: Span, kind: InferKind<'v>) -> Self::Result {
370365
self.visit_id(inf_id)
371366
}
372367

@@ -894,9 +889,7 @@ pub fn walk_generic_arg<'v, V: Visitor<'v>>(
894889
GenericArg::Lifetime(lt) => visitor.visit_lifetime(lt),
895890
GenericArg::Type(ty) => visitor.visit_ty(ty),
896891
GenericArg::Const(ct) => visitor.visit_const_arg(ct),
897-
GenericArg::Infer(inf) => {
898-
visitor.visit_shared_ty_const(inf.hir_id, inf.span, InferKind::Ambig(inf))
899-
}
892+
GenericArg::Infer(inf) => visitor.visit_infer(inf.hir_id, inf.span, InferKind::Ambig(inf)),
900893
}
901894
}
902895

@@ -905,7 +898,7 @@ pub fn walk_unambig_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty<'v>) ->
905898
Some(ambig_ty) => visitor.visit_ty(ambig_ty),
906899
None => {
907900
try_visit!(visitor.visit_id(typ.hir_id));
908-
visitor.visit_shared_ty_const(typ.hir_id, typ.span, InferKind::Ty(typ))
901+
visitor.visit_infer(typ.hir_id, typ.span, InferKind::Ty(typ))
909902
}
910903
}
911904
}
@@ -969,11 +962,7 @@ pub fn walk_const_arg<'v, V: Visitor<'v>>(
969962
Some(ambig_ct) => visitor.visit_const_arg(ambig_ct),
970963
None => {
971964
try_visit!(visitor.visit_id(const_arg.hir_id));
972-
visitor.visit_shared_ty_const(
973-
const_arg.hir_id,
974-
const_arg.span(),
975-
InferKind::Const(const_arg),
976-
)
965+
visitor.visit_infer(const_arg.hir_id, const_arg.span(), InferKind::Const(const_arg))
977966
}
978967
}
979968
}

compiler/rustc_hir_analysis/src/collect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ pub(crate) struct HirPlaceholderCollector {
139139
}
140140

141141
impl<'v> Visitor<'v> for HirPlaceholderCollector {
142-
fn visit_shared_ty_const(
142+
fn visit_infer(
143143
&mut self,
144144
_inf_id: HirId,
145145
inf_span: Span,

compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ impl<'a, 'tcx> Visitor<'tcx> for BoundVarContext<'a, 'tcx> {
490490
impl<'v> Visitor<'v> for FindInferInClosureWithBinder {
491491
type Result = ControlFlow<Span>;
492492

493-
fn visit_shared_ty_const(
493+
fn visit_infer(
494494
&mut self,
495495
_inf_id: HirId,
496496
inf_span: Span,

compiler/rustc_hir_typeck/src/fallback.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ impl<'tcx> AnnotateUnitFallbackVisitor<'_, 'tcx> {
641641
impl<'tcx> Visitor<'tcx> for AnnotateUnitFallbackVisitor<'_, 'tcx> {
642642
type Result = ControlFlow<errors::SuggestAnnotation>;
643643

644-
fn visit_shared_ty_const(
644+
fn visit_infer(
645645
&mut self,
646646
inf_id: HirId,
647647
inf_span: Span,

compiler/rustc_hir_typeck/src/writeback.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ impl<'cx, 'tcx> Visitor<'tcx> for WritebackCx<'cx, 'tcx> {
351351
}
352352
}
353353

354-
fn visit_shared_ty_const(
354+
fn visit_infer(
355355
&mut self,
356356
inf_id: HirId,
357357
inf_span: Span,

compiler/rustc_privacy/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,7 @@ impl<'tcx> Visitor<'tcx> for TypePrivacyVisitor<'tcx> {
11061106
intravisit::walk_ty(self, hir_ty);
11071107
}
11081108

1109-
fn visit_shared_ty_const(
1109+
fn visit_infer(
11101110
&mut self,
11111111
inf_id: rustc_hir::HirId,
11121112
inf_span: Span,

src/librustdoc/visit_ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ impl<'tcx> Visitor<'tcx> for RustdocVisitor<'_, 'tcx> {
598598
// Unneeded.
599599
}
600600

601-
fn visit_shared_ty_const(
601+
fn visit_infer(
602602
&mut self,
603603
_inf_id: hir::HirId,
604604
_inf_span: Span,

src/tools/clippy/clippy_lints/src/box_default.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ fn is_local_vec_expn(cx: &LateContext<'_>, expr: &Expr<'_>, ref_expr: &Expr<'_>)
9292
struct InferVisitor(bool);
9393

9494
impl Visitor<'_> for InferVisitor {
95-
fn visit_shared_ty_const(&mut self, inf_id: HirId, _inf_span: Span, _kind: InferKind<'_>) -> Self::Result {
95+
fn visit_infer(&mut self, inf_id: HirId, _inf_span: Span, _kind: InferKind<'_>) -> Self::Result {
9696
self.0 = true;
9797
self.visit_id(inf_id);
9898
}

src/tools/clippy/clippy_lints/src/dereference.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,7 @@ impl TyCoercionStability {
889889
fn ty_contains_infer(ty: &hir::Ty<'_>) -> bool {
890890
struct V(bool);
891891
impl Visitor<'_> for V {
892-
fn visit_shared_ty_const(&mut self, inf_id: HirId, _inf_span: Span, kind: InferKind<'_>) -> Self::Result {
892+
fn visit_infer(&mut self, inf_id: HirId, _inf_span: Span, kind: InferKind<'_>) -> Self::Result {
893893
if let InferKind::Ty(_) | InferKind::Ambig(_) = kind {
894894
self.0 = true;
895895
}

0 commit comments

Comments
 (0)