Skip to content

Commit 7924ecc

Browse files
authored
Rollup merge of #78830 - lcnr:mir-folder, r=oli-obk
fix `super_visit_with` for `Terminator` fixes #78182 (comment) r? `@oli-obk` cc `@LeSeulArtichaut`
2 parents 4e0695b + 103f7a4 commit 7924ecc

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

compiler/rustc_middle/src/mir/type_foldable.rs

+14-17
Original file line numberDiff line numberDiff line change
@@ -109,24 +109,21 @@ impl<'tcx> TypeFoldable<'tcx> for Terminator<'tcx> {
109109
args.visit_with(visitor)
110110
}
111111
Assert { ref cond, ref msg, .. } => {
112-
if cond.visit_with(visitor).is_break() {
113-
use AssertKind::*;
114-
match msg {
115-
BoundsCheck { ref len, ref index } => {
116-
len.visit_with(visitor)?;
117-
index.visit_with(visitor)
118-
}
119-
Overflow(_, l, r) => {
120-
l.visit_with(visitor)?;
121-
r.visit_with(visitor)
122-
}
123-
OverflowNeg(op) | DivisionByZero(op) | RemainderByZero(op) => {
124-
op.visit_with(visitor)
125-
}
126-
ResumedAfterReturn(_) | ResumedAfterPanic(_) => ControlFlow::CONTINUE,
112+
cond.visit_with(visitor)?;
113+
use AssertKind::*;
114+
match msg {
115+
BoundsCheck { ref len, ref index } => {
116+
len.visit_with(visitor)?;
117+
index.visit_with(visitor)
118+
}
119+
Overflow(_, l, r) => {
120+
l.visit_with(visitor)?;
121+
r.visit_with(visitor)
122+
}
123+
OverflowNeg(op) | DivisionByZero(op) | RemainderByZero(op) => {
124+
op.visit_with(visitor)
127125
}
128-
} else {
129-
ControlFlow::CONTINUE
126+
ResumedAfterReturn(_) | ResumedAfterPanic(_) => ControlFlow::CONTINUE,
130127
}
131128
}
132129
InlineAsm { ref operands, .. } => operands.visit_with(visitor),

0 commit comments

Comments
 (0)