visit_x_unambig

This commit is contained in:
Boxy
2025-01-18 22:45:41 +00:00
parent 109440b830
commit 6ed958869d
7 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -109,7 +109,7 @@ fn given_type(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
match cx.tcx.parent_hir_node(expr.hir_id) {
Node::LetStmt(LetStmt { ty: Some(ty), .. }) => {
let mut v = InferVisitor::default();
v.visit_unambig_ty(ty);
v.visit_ty_unambig(ty);
!v.0
},
Node::Expr(Expr {
+1 -1
View File
@@ -905,7 +905,7 @@ fn visit_ty(&mut self, ty: &hir::Ty<'_, AmbigArg>) {
}
}
let mut v = V(false);
v.visit_unambig_ty(ty);
v.visit_ty_unambig(ty);
v.0
}
+3 -3
View File
@@ -2,7 +2,7 @@
use std::collections::BTreeMap;
use rustc_errors::{Applicability, Diag};
use rustc_hir::intravisit::{Visitor, VisitorExt, walk_ty, walk_body, walk_expr};
use rustc_hir::intravisit::{Visitor, VisitorExt, walk_body, walk_expr, walk_ty};
use rustc_hir::{self as hir, AmbigArg, Body, Expr, ExprKind, GenericArg, Item, ItemKind, QPath, TyKind};
use rustc_hir_analysis::lower_ty;
use rustc_lint::{LateContext, LateLintPass};
@@ -111,7 +111,7 @@ fn suggestion(
match item.kind {
ItemKind::Impl(impl_) => {
let mut vis = ImplicitHasherTypeVisitor::new(cx);
vis.visit_unambig_ty(impl_.self_ty);
vis.visit_ty_unambig(impl_.self_ty);
for target in &vis.found {
if !item.span.eq_ctxt(target.span()) {
@@ -158,7 +158,7 @@ fn suggestion(
for ty in sig.decl.inputs {
let mut vis = ImplicitHasherTypeVisitor::new(cx);
vis.visit_unambig_ty(ty);
vis.visit_ty_unambig(ty);
for target in &vis.found {
if generics.span.from_expansion() {
+4 -4
View File
@@ -232,11 +232,11 @@ fn could_use_elision<'tcx>(
// extract lifetimes in input argument types
for arg in func.inputs {
input_visitor.visit_unambig_ty(arg);
input_visitor.visit_ty_unambig(arg);
}
// extract lifetimes in output type
if let Return(ty) = func.output {
output_visitor.visit_unambig_ty(ty);
output_visitor.visit_ty_unambig(ty);
}
for lt in named_generics {
input_visitor.visit_generic_param(lt);
@@ -340,7 +340,7 @@ fn explicit_self_type<'tcx>(cx: &LateContext<'tcx>, func: &FnDecl<'tcx>, ident:
&& let Some(self_ty) = func.inputs.first()
{
let mut visitor = RefVisitor::new(cx);
visitor.visit_unambig_ty(self_ty);
visitor.visit_ty_unambig(self_ty);
!visitor.all_lts().is_empty()
} else {
@@ -541,7 +541,7 @@ fn visit_where_bound_predicate(
try_visit!(self.visit_id(hir_id));
self.bounded_ty_depth += 1;
try_visit!(self.visit_unambig_ty(bounded_ty));
try_visit!(self.visit_ty_unambig(bounded_ty));
self.bounded_ty_depth -= 1;
walk_list!(self, visit_param_bound, bounds);
+1 -1
View File
@@ -10,7 +10,7 @@
pub(super) fn check(cx: &LateContext<'_>, ty: &hir::Ty<'_>, type_complexity_threshold: u64) -> bool {
let score = {
let mut visitor = TypeComplexityVisitor { score: 0, nest: 1 };
visitor.visit_unambig_ty(ty);
visitor.visit_ty_unambig(ty);
visitor.score
};
+1 -1
View File
@@ -179,7 +179,7 @@ fn check_impl_item(&mut self, cx: &LateContext<'_>, impl_item: &hir::ImplItem<'_
for (impl_hir_ty, trait_sem_ty) in impl_inputs_outputs.zip(trait_method_sig.inputs_and_output) {
if trait_sem_ty.walk().any(|inner| inner == self_ty.into()) {
let mut visitor = SkipTyCollector::default();
visitor.visit_unambig_ty(impl_hir_ty);
visitor.visit_ty_unambig(impl_hir_ty);
types_to_skip.extend(visitor.types_to_skip);
}
}
+1 -1
View File
@@ -140,7 +140,7 @@ fn type_certainty(cx: &LateContext<'_>, ty: &hir::Ty<'_>) -> Certainty {
}
let mut visitor = CertaintyVisitor::new(cx);
visitor.visit_unambig_ty(ty);
visitor.visit_ty_unambig(ty);
visitor.certainty
}