Rollup merge of #144996 - dianqk:simplifycfg-collapse_goto_chain-changed, r=cjgillot

simplifycfg: Mark as changed when start is modified in collapse goto chain

Split from rust-lang/rust#142771.
r? cjgillot
This commit is contained in:
Guillaume Gomez
2025-08-06 21:29:33 +02:00
committed by GitHub

View File

@@ -225,6 +225,7 @@ impl<'a, 'tcx> CfgSimplifier<'a, 'tcx> {
current = target;
}
let last = current;
*changed |= *start != last;
*start = last;
while let Some((current, mut terminator)) = terminators.pop() {
let Terminator { kind: TerminatorKind::Goto { ref mut target }, .. } = terminator