Skip to content

Commit 1bffc9f

Browse files
committed
clarify terminator in replace unwind
1 parent 59dcd93 commit 1bffc9f

File tree

1 file changed

+3
-1
lines changed
  • compiler/rustc_mir_build/src/build

1 file changed

+3
-1
lines changed

compiler/rustc_mir_build/src/build/scope.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,9 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
11351135

11361136
let assign = self.cfg.start_new_cleanup_block();
11371137
self.cfg.push_assign(assign, statement_source_info, place, value.clone());
1138-
self.cfg.terminate(assign, statement_source_info, TerminatorKind::Goto { target: block });
1138+
// We still have to build the scope drops so we don't know which block will follow.
1139+
// This terminator will be overwritten once the unwind drop tree builder runs.
1140+
self.cfg.terminate(assign, statement_source_info, TerminatorKind::Unreachable);
11391141

11401142
self.cfg.terminate(
11411143
block,

0 commit comments

Comments
 (0)