Fix new usage of old api
This commit is contained in:
parent
e29b5badbc
commit
c5829c2ee5
3 changed files with 5 additions and 5 deletions
|
@ -56,7 +56,7 @@ impl<'tcx, 'body> ParseCtxt<'tcx, 'body> {
|
|||
Ok(TerminatorKind::Drop {
|
||||
place: self.parse_place(args[0])?,
|
||||
target: self.parse_block(args[1])?,
|
||||
unwind: None,
|
||||
unwind: UnwindAction::Continue,
|
||||
})
|
||||
},
|
||||
@call("mir_call", args) => {
|
||||
|
@ -126,7 +126,7 @@ impl<'tcx, 'body> ParseCtxt<'tcx, 'body> {
|
|||
args,
|
||||
destination,
|
||||
target: Some(target),
|
||||
cleanup: None,
|
||||
unwind: UnwindAction::Continue,
|
||||
from_hir_call: *from_hir_call,
|
||||
fn_span: *fn_span,
|
||||
})
|
||||
|
|
|
@ -1438,11 +1438,11 @@ impl<'tcx> DropTreeBuilder<'tcx> for Unwind {
|
|||
let term = &mut cfg.block_data_mut(from).terminator_mut();
|
||||
match &mut term.kind {
|
||||
TerminatorKind::Drop { unwind, .. } => {
|
||||
if let Some(unwind) = *unwind {
|
||||
if let UnwindAction::Cleanup(unwind) = *unwind {
|
||||
let source_info = term.source_info;
|
||||
cfg.terminate(unwind, source_info, TerminatorKind::Goto { target: to });
|
||||
} else {
|
||||
*unwind = Some(to);
|
||||
*unwind = UnwindAction::Cleanup(to);
|
||||
}
|
||||
}
|
||||
TerminatorKind::FalseUnwind { unwind, .. }
|
||||
|
|
|
@ -160,7 +160,7 @@ fn remove_dead_unwinds<'tcx>(
|
|||
let basic_blocks = body.basic_blocks.as_mut();
|
||||
for &bb in dead_unwinds.iter() {
|
||||
if let Some(unwind) = basic_blocks[bb].terminator_mut().unwind_mut() {
|
||||
*unwind = None;
|
||||
*unwind = UnwindAction::Unreachable;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue