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

@ -32,7 +32,7 @@ use rustc_target::abi;
use rustc_target::asm::InlineAsmRegOrRegClass;
use std::borrow::Cow;
use std::fmt::{self, Debug, Display, Formatter, Write};
use std::ops::{Index, IndexMut};
use std::ops::{ControlFlow, Index, IndexMut};
use std::slice;
use std::{iter, mem, option};
@ -2489,7 +2489,7 @@ impl<'tcx> TypeFoldable<'tcx> for UserTypeProjection {
UserTypeProjection { base, projs }
}
fn super_visit_with<Vs: TypeVisitor<'tcx>>(&self, visitor: &mut Vs) -> bool {
fn super_visit_with<Vs: TypeVisitor<'tcx>>(&self, visitor: &mut Vs) -> ControlFlow<(), ()> {
self.base.visit_with(visitor)
// Note: there's nothing in `self.proj` to visit.
}