1
Fork 0

TypeVisitor: use ControlFlow in rustc_{infer,lint,trait_selection}

This commit is contained in:
LeSeulArtichaut 2020-10-21 14:24:35 +02:00
parent 2c85b6fae0
commit 4fe735b320
13 changed files with 106 additions and 82 deletions

View file

@ -4,6 +4,7 @@ use rustc_middle::ty;
use rustc_middle::ty::fold::{TypeFoldable, TypeFolder, TypeVisitor};
use std::fmt;
use std::ops::ControlFlow;
// Structural impls for the structs in `traits`.
@ -68,7 +69,7 @@ impl<'tcx, O: TypeFoldable<'tcx>> TypeFoldable<'tcx> for traits::Obligation<'tcx
}
}
fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool {
fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> ControlFlow<(), ()> {
self.predicate.visit_with(visitor)
}
}