visit_x_unambig
This commit is contained in:
parent
6833c27090
commit
2bdeff2fb8
27 changed files with 92 additions and 92 deletions
|
@ -1624,7 +1624,7 @@ fn compare_synthetic_generics<'tcx>(
|
|||
|
||||
let span = input_tys
|
||||
.iter()
|
||||
.find_map(|ty| Visitor(impl_def_id).visit_unambig_ty(ty).break_value())?;
|
||||
.find_map(|ty| Visitor(impl_def_id).visit_ty_unambig(ty).break_value())?;
|
||||
|
||||
let bounds = impl_m.generics.bounds_for_param(impl_def_id).next()?.bounds;
|
||||
let bounds = bounds.first()?.span().to(bounds.last()?.span());
|
||||
|
|
|
@ -576,7 +576,7 @@ impl<'tcx> HirTyLowerer<'tcx> for ItemCtxt<'tcx> {
|
|||
}
|
||||
|
||||
// Only visit the type looking for `_` if we didn't fix the type above
|
||||
visitor.visit_unambig_ty(a);
|
||||
visitor.visit_ty_unambig(a);
|
||||
self.lowerer().lower_arg_ty(a, None)
|
||||
})
|
||||
.collect();
|
||||
|
@ -590,7 +590,7 @@ impl<'tcx> HirTyLowerer<'tcx> for ItemCtxt<'tcx> {
|
|||
infer_replacements.push((output.span, suggested_ty.to_string()));
|
||||
Ty::new_error_with_message(tcx, output.span, suggested_ty.to_string())
|
||||
} else {
|
||||
visitor.visit_unambig_ty(output);
|
||||
visitor.visit_ty_unambig(output);
|
||||
self.lower_ty(output)
|
||||
}
|
||||
}
|
||||
|
@ -1436,7 +1436,7 @@ fn recover_infer_ret_ty<'tcx>(
|
|||
});
|
||||
|
||||
let mut visitor = HirPlaceholderCollector::default();
|
||||
visitor.visit_unambig_ty(infer_ret_ty);
|
||||
visitor.visit_ty_unambig(infer_ret_ty);
|
||||
|
||||
let mut diag = bad_placeholder(icx.lowerer(), visitor.spans, "return type");
|
||||
let ret_ty = fn_sig.output();
|
||||
|
|
|
@ -540,7 +540,7 @@ impl<'v> Visitor<'v> for AnonConstInParamTyDetector {
|
|||
if let GenericParamKind::Const { ty, default: _, synthetic: _ } = p.kind {
|
||||
let prev = self.in_param_ty;
|
||||
self.in_param_ty = true;
|
||||
let res = self.visit_unambig_ty(ty);
|
||||
let res = self.visit_ty_unambig(ty);
|
||||
self.in_param_ty = prev;
|
||||
res
|
||||
} else {
|
||||
|
|
|
@ -499,7 +499,7 @@ impl<'a, 'tcx> Visitor<'tcx> for BoundVarContext<'a, 'tcx> {
|
|||
ControlFlow::Break(inf_span)
|
||||
}
|
||||
}
|
||||
FindInferInClosureWithBinder.visit_unambig_ty(ty).break_value()
|
||||
FindInferInClosureWithBinder.visit_ty_unambig(ty).break_value()
|
||||
}
|
||||
|
||||
let infer_in_rt_sp = match fn_decl.output {
|
||||
|
@ -853,7 +853,7 @@ impl<'a, 'tcx> Visitor<'tcx> for BoundVarContext<'a, 'tcx> {
|
|||
lifetime: self.map.defs.get(&lifetime_ref.hir_id.local_id).cloned(),
|
||||
s: self.scope,
|
||||
};
|
||||
self.with(scope, |this| this.visit_unambig_ty(mt.ty));
|
||||
self.with(scope, |this| this.visit_ty_unambig(mt.ty));
|
||||
}
|
||||
hir::TyKind::TraitAscription(bounds) => {
|
||||
let scope = Scope::TraitRefBoundary { s: self.scope };
|
||||
|
@ -895,7 +895,7 @@ impl<'a, 'tcx> Visitor<'tcx> for BoundVarContext<'a, 'tcx> {
|
|||
this.visit_param_bound(bound);
|
||||
}
|
||||
if let Some(ty) = ty {
|
||||
this.visit_unambig_ty(ty);
|
||||
this.visit_ty_unambig(ty);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -914,7 +914,7 @@ impl<'a, 'tcx> Visitor<'tcx> for BoundVarContext<'a, 'tcx> {
|
|||
}),
|
||||
Type(ty) => self.visit_early(impl_item.hir_id(), impl_item.generics, |this| {
|
||||
this.visit_generics(impl_item.generics);
|
||||
this.visit_unambig_ty(ty);
|
||||
this.visit_ty_unambig(ty);
|
||||
}),
|
||||
Const(_, _) => self.visit_early(impl_item.hir_id(), impl_item.generics, |this| {
|
||||
intravisit::walk_impl_item(this, impl_item)
|
||||
|
@ -1023,7 +1023,7 @@ impl<'a, 'tcx> Visitor<'tcx> for BoundVarContext<'a, 'tcx> {
|
|||
};
|
||||
self.with(scope, |this| {
|
||||
walk_list!(this, visit_generic_param, bound_generic_params);
|
||||
this.visit_unambig_ty(bounded_ty);
|
||||
this.visit_ty_unambig(bounded_ty);
|
||||
walk_list!(this, visit_param_bound, bounds);
|
||||
})
|
||||
}
|
||||
|
@ -1038,8 +1038,8 @@ impl<'a, 'tcx> Visitor<'tcx> for BoundVarContext<'a, 'tcx> {
|
|||
&hir::WherePredicateKind::EqPredicate(hir::WhereEqPredicate {
|
||||
lhs_ty, rhs_ty, ..
|
||||
}) => {
|
||||
self.visit_unambig_ty(lhs_ty);
|
||||
self.visit_unambig_ty(rhs_ty);
|
||||
self.visit_ty_unambig(lhs_ty);
|
||||
self.visit_ty_unambig(rhs_ty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1072,13 +1072,13 @@ impl<'a, 'tcx> Visitor<'tcx> for BoundVarContext<'a, 'tcx> {
|
|||
GenericParamKind::Lifetime { .. } => {}
|
||||
GenericParamKind::Type { default, .. } => {
|
||||
if let Some(ty) = default {
|
||||
self.visit_unambig_ty(ty);
|
||||
self.visit_ty_unambig(ty);
|
||||
}
|
||||
}
|
||||
GenericParamKind::Const { ty, default, .. } => {
|
||||
self.visit_unambig_ty(ty);
|
||||
self.visit_ty_unambig(ty);
|
||||
if let Some(default) = default {
|
||||
self.visit_unambig_const_arg(default);
|
||||
self.visit_const_arg_unambig(default);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1987,15 +1987,15 @@ impl<'a, 'tcx> BoundVarContext<'a, 'tcx> {
|
|||
},
|
||||
|this| {
|
||||
for input in inputs {
|
||||
this.visit_unambig_ty(input);
|
||||
this.visit_ty_unambig(input);
|
||||
}
|
||||
if !in_closure && let Some(output) = output {
|
||||
this.visit_unambig_ty(output);
|
||||
this.visit_ty_unambig(output);
|
||||
}
|
||||
},
|
||||
);
|
||||
if in_closure && let Some(output) = output {
|
||||
self.visit_unambig_ty(output);
|
||||
self.visit_ty_unambig(output);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2313,7 +2313,7 @@ fn is_late_bound_map(
|
|||
|
||||
let mut constrained_by_input = ConstrainedCollector { regions: Default::default(), tcx };
|
||||
for arg_ty in sig.decl.inputs {
|
||||
constrained_by_input.visit_unambig_ty(arg_ty);
|
||||
constrained_by_input.visit_ty_unambig(arg_ty);
|
||||
}
|
||||
|
||||
let mut appears_in_output =
|
||||
|
|
|
@ -450,7 +450,7 @@ fn infer_placeholder_type<'tcx>(
|
|||
let mut visitor = HirPlaceholderCollector::default();
|
||||
let node = tcx.hir_node_by_def_id(def_id);
|
||||
if let Some(ty) = node.ty() {
|
||||
visitor.visit_unambig_ty(ty);
|
||||
visitor.visit_ty_unambig(ty);
|
||||
}
|
||||
// If we have just one span, let's try to steal a const `_` feature error.
|
||||
let try_steal_span = if !tcx.features().generic_arg_infer() && visitor.spans.len() == 1
|
||||
|
@ -532,5 +532,5 @@ pub(crate) fn type_alias_is_lazy<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) ->
|
|||
}
|
||||
}
|
||||
}
|
||||
HasTait.visit_unambig_ty(tcx.hir().expect_item(def_id).expect_ty_alias().0).is_break()
|
||||
HasTait.visit_ty_unambig(tcx.hir().expect_item(def_id).expect_ty_alias().0).is_break()
|
||||
}
|
||||
|
|
|
@ -201,7 +201,7 @@ fn diagnostic_hir_wf_check<'tcx>(
|
|||
}
|
||||
};
|
||||
for ty in tys {
|
||||
visitor.visit_unambig_ty(ty);
|
||||
visitor.visit_ty_unambig(ty);
|
||||
}
|
||||
visitor.cause
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue