Remove implicit Continue type

This commit is contained in:
LeSeulArtichaut 2020-10-25 11:50:56 +01:00
parent 24e1a7e656
commit 9433eb83fe
30 changed files with 129 additions and 135 deletions

View file

@ -693,12 +693,12 @@ impl<'tcx, OP> TypeVisitor<'tcx> for ConstrainOpaqueTypeRegionVisitor<OP>
where
OP: FnMut(ty::Region<'tcx>),
{
fn visit_binder<T: TypeFoldable<'tcx>>(&mut self, t: &ty::Binder<T>) -> ControlFlow<(), ()> {
fn visit_binder<T: TypeFoldable<'tcx>>(&mut self, t: &ty::Binder<T>) -> ControlFlow<()> {
t.as_ref().skip_binder().visit_with(self);
ControlFlow::CONTINUE
}
fn visit_region(&mut self, r: ty::Region<'tcx>) -> ControlFlow<(), ()> {
fn visit_region(&mut self, r: ty::Region<'tcx>) -> ControlFlow<()> {
match *r {
// ignore bound regions, keep visiting
ty::ReLateBound(_, _) => ControlFlow::CONTINUE,
@ -709,7 +709,7 @@ where
}
}
fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<(), ()> {
fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<()> {
// We're only interested in types involving regions
if !ty.flags().intersects(ty::TypeFlags::HAS_FREE_REGIONS) {
return ControlFlow::CONTINUE;

View file

@ -571,15 +571,15 @@ pub fn walk_abstract_const<'tcx, F>(
tcx: TyCtxt<'tcx>,
ct: AbstractConst<'tcx>,
mut f: F,
) -> ControlFlow<(), ()>
) -> ControlFlow<()>
where
F: FnMut(Node<'tcx>) -> ControlFlow<(), ()>,
F: FnMut(Node<'tcx>) -> ControlFlow<()>,
{
fn recurse<'tcx>(
tcx: TyCtxt<'tcx>,
ct: AbstractConst<'tcx>,
f: &mut dyn FnMut(Node<'tcx>) -> ControlFlow<(), ()>,
) -> ControlFlow<(), ()> {
f: &mut dyn FnMut(Node<'tcx>) -> ControlFlow<()>,
) -> ControlFlow<()> {
let root = ct.root();
f(root)?;
match root {

View file

@ -771,7 +771,7 @@ fn contains_illegal_self_type_reference<'tcx, T: TypeFoldable<'tcx>>(
}
impl<'tcx> TypeVisitor<'tcx> for IllegalSelfTypeVisitor<'tcx> {
fn visit_ty(&mut self, t: Ty<'tcx>) -> ControlFlow<(), ()> {
fn visit_ty(&mut self, t: Ty<'tcx>) -> ControlFlow<()> {
match t.kind() {
ty::Param(_) => {
if t == self.tcx.types.self_param {
@ -812,7 +812,7 @@ fn contains_illegal_self_type_reference<'tcx, T: TypeFoldable<'tcx>>(
}
}
fn visit_const(&mut self, ct: &ty::Const<'tcx>) -> ControlFlow<(), ()> {
fn visit_const(&mut self, ct: &ty::Const<'tcx>) -> ControlFlow<()> {
// First check if the type of this constant references `Self`.
self.visit_ty(ct.ty)?;
@ -844,7 +844,7 @@ fn contains_illegal_self_type_reference<'tcx, T: TypeFoldable<'tcx>>(
}
}
fn visit_predicate(&mut self, pred: ty::Predicate<'tcx>) -> ControlFlow<(), ()> {
fn visit_predicate(&mut self, pred: ty::Predicate<'tcx>) -> ControlFlow<()> {
if let ty::PredicateAtom::ConstEvaluatable(def, substs) = pred.skip_binders() {
// FIXME(const_evaluatable_checked): We should probably deduplicate the logic for
// `AbstractConst`s here, it might make sense to change `ConstEvaluatable` to

View file

@ -135,7 +135,7 @@ impl Search<'a, 'tcx> {
}
impl<'a, 'tcx> TypeVisitor<'tcx> for Search<'a, 'tcx> {
fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<(), ()> {
fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<()> {
debug!("Search visiting ty: {:?}", ty);
let (adt_def, substs) = match *ty.kind() {