Skip to content

Commit c5829c2

Browse files
committed
Fix new usage of old api
1 parent e29b5ba commit c5829c2

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

compiler/rustc_mir_build/src/build/custom/parse/instruction.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl<'tcx, 'body> ParseCtxt<'tcx, 'body> {
5656
Ok(TerminatorKind::Drop {
5757
place: self.parse_place(args[0])?,
5858
target: self.parse_block(args[1])?,
59-
unwind: None,
59+
unwind: UnwindAction::Continue,
6060
})
6161
},
6262
@call("mir_call", args) => {
@@ -126,7 +126,7 @@ impl<'tcx, 'body> ParseCtxt<'tcx, 'body> {
126126
args,
127127
destination,
128128
target: Some(target),
129-
cleanup: None,
129+
unwind: UnwindAction::Continue,
130130
from_hir_call: *from_hir_call,
131131
fn_span: *fn_span,
132132
})

compiler/rustc_mir_build/src/build/scope.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,11 +1438,11 @@ impl<'tcx> DropTreeBuilder<'tcx> for Unwind {
14381438
let term = &mut cfg.block_data_mut(from).terminator_mut();
14391439
match &mut term.kind {
14401440
TerminatorKind::Drop { unwind, .. } => {
1441-
if let Some(unwind) = *unwind {
1441+
if let UnwindAction::Cleanup(unwind) = *unwind {
14421442
let source_info = term.source_info;
14431443
cfg.terminate(unwind, source_info, TerminatorKind::Goto { target: to });
14441444
} else {
1445-
*unwind = Some(to);
1445+
*unwind = UnwindAction::Cleanup(to);
14461446
}
14471447
}
14481448
TerminatorKind::FalseUnwind { unwind, .. }

compiler/rustc_mir_transform/src/elaborate_drops.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ fn remove_dead_unwinds<'tcx>(
160160
let basic_blocks = body.basic_blocks.as_mut();
161161
for &bb in dead_unwinds.iter() {
162162
if let Some(unwind) = basic_blocks[bb].terminator_mut().unwind_mut() {
163-
*unwind = None;
163+
*unwind = UnwindAction::Unreachable;
164164
}
165165
}
166166
}

0 commit comments

Comments
 (0)