mir: Use the new method for BasicBlockData
This commit is contained in:
@@ -44,11 +44,10 @@ impl<'tcx> crate::MirPass<'tcx> for AddCallGuards {
|
||||
|
||||
let cur_len = body.basic_blocks.len();
|
||||
let mut new_block = |source_info: SourceInfo, is_cleanup: bool, target: BasicBlock| {
|
||||
let block = BasicBlockData {
|
||||
statements: vec![],
|
||||
let block = BasicBlockData::new(
|
||||
Some(Terminator { source_info, kind: TerminatorKind::Goto { target } }),
|
||||
is_cleanup,
|
||||
terminator: Some(Terminator { source_info, kind: TerminatorKind::Goto { target } }),
|
||||
};
|
||||
);
|
||||
let idx = cur_len + new_blocks.len();
|
||||
new_blocks.push(block);
|
||||
BasicBlock::new(idx)
|
||||
|
||||
Reference in New Issue
Block a user