1
Fork 0

Auto merge of #78779 - LeSeulArtichaut:ty-visitor-return, r=oli-obk

Introduce `TypeVisitor::BreakTy`

Implements MCP rust-lang/compiler-team#383.
r? `@ghost`
cc `@lcnr` `@oli-obk`

~~Blocked on FCP in rust-lang/compiler-team#383.~~
This commit is contained in:
bors 2020-11-17 12:24:34 +00:00
commit e0ef0fc392
32 changed files with 232 additions and 213 deletions

View file

@ -62,7 +62,7 @@ macro_rules! TrivialTypeFoldableImpls {
fn super_visit_with<F: $crate::ty::fold::TypeVisitor<$tcx>>(
&self,
_: &mut F)
-> ::std::ops::ControlFlow<()>
-> ::std::ops::ControlFlow<F::BreakTy>
{
::std::ops::ControlFlow::CONTINUE
}
@ -105,7 +105,7 @@ macro_rules! EnumTypeFoldableImpl {
fn super_visit_with<V: $crate::ty::fold::TypeVisitor<$tcx>>(
&self,
visitor: &mut V,
) -> ::std::ops::ControlFlow<()> {
) -> ::std::ops::ControlFlow<V::BreakTy> {
EnumTypeFoldableImpl!(@VisitVariants(self, visitor) input($($variants)*) output())
}
}