diff options
| author | Bastian Kauschke <bastian_kauschke@hotmail.de> | 2020-11-07 11:54:35 +0100 |
|---|---|---|
| committer | Bastian Kauschke <bastian_kauschke@hotmail.de> | 2020-11-07 11:56:31 +0100 |
| commit | 103f7a499b2eeff908ce9234c812262a9e87a16f (patch) | |
| tree | 7309d6f5618d89eba3c62bcb64a5c06e4f183627 /compiler/rustc_middle/src/mir | |
| parent | a601302ff0217b91589b5a7310a8a23adb843fdc (diff) | |
| download | rust-103f7a499b2eeff908ce9234c812262a9e87a16f.tar.gz rust-103f7a499b2eeff908ce9234c812262a9e87a16f.zip | |
fix `super_visit_with` for `Terminator`
Diffstat (limited to 'compiler/rustc_middle/src/mir')
| -rw-r--r-- | compiler/rustc_middle/src/mir/type_foldable.rs | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/compiler/rustc_middle/src/mir/type_foldable.rs b/compiler/rustc_middle/src/mir/type_foldable.rs index 391bd8be7e4..0801188b278 100644 --- a/compiler/rustc_middle/src/mir/type_foldable.rs +++ b/compiler/rustc_middle/src/mir/type_foldable.rs @@ -109,24 +109,21 @@ impl<'tcx> TypeFoldable<'tcx> for Terminator<'tcx> { args.visit_with(visitor) } Assert { ref cond, ref msg, .. } => { - if cond.visit_with(visitor).is_break() { - use AssertKind::*; - match msg { - BoundsCheck { ref len, ref index } => { - len.visit_with(visitor)?; - index.visit_with(visitor) - } - Overflow(_, l, r) => { - l.visit_with(visitor)?; - r.visit_with(visitor) - } - OverflowNeg(op) | DivisionByZero(op) | RemainderByZero(op) => { - op.visit_with(visitor) - } - ResumedAfterReturn(_) | ResumedAfterPanic(_) => ControlFlow::CONTINUE, + cond.visit_with(visitor)?; + use AssertKind::*; + match msg { + BoundsCheck { ref len, ref index } => { + len.visit_with(visitor)?; + index.visit_with(visitor) + } + Overflow(_, l, r) => { + l.visit_with(visitor)?; + r.visit_with(visitor) + } + OverflowNeg(op) | DivisionByZero(op) | RemainderByZero(op) => { + op.visit_with(visitor) } - } else { - ControlFlow::CONTINUE + ResumedAfterReturn(_) | ResumedAfterPanic(_) => ControlFlow::CONTINUE, } } InlineAsm { ref operands, .. } => operands.visit_with(visitor), |
