TypeVisitor: use std::ops::ControlFlow instead of bool

This commit is contained in:
LeSeulArtichaut 2020-10-21 14:22:44 +02:00
parent 8df58ae03a
commit 2c85b6fae0
10 changed files with 243 additions and 165 deletions

View file

@ -46,7 +46,7 @@ use std::cell::RefCell;
use std::cmp::Ordering;
use std::fmt;
use std::hash::{Hash, Hasher};
use std::ops::Range;
use std::ops::{ControlFlow, Range};
use std::ptr;
use std::str;
@ -1776,8 +1776,9 @@ impl<'tcx> TypeFoldable<'tcx> for ParamEnv<'tcx> {
ParamEnv::new(self.caller_bounds().fold_with(folder), self.reveal().fold_with(folder))
}
fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool {
self.caller_bounds().visit_with(visitor) || self.reveal().visit_with(visitor)
fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> ControlFlow<(), ()> {
self.caller_bounds().visit_with(visitor)?;
self.reveal().visit_with(visitor)
}
}