Skip to content

Commit c74c22b

Browse files
committed
Only call new_block once.
1 parent ac9e3c4 commit c74c22b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

compiler/rustc_mir_transform/src/add_call_guards.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,22 +101,22 @@ impl<'tcx> crate::MirPass<'tcx> for AddCallGuards {
101101
let is_cleanup = block.is_cleanup;
102102
let term = block.terminator_mut();
103103
let source_info = term.source_info;
104-
match action {
104+
let destination = match action {
105105
Action::Call => {
106106
let TerminatorKind::Call { target: Some(ref mut destination), .. } = term.kind
107107
else {
108108
unreachable!()
109109
};
110-
*destination = new_block(source_info, is_cleanup, *destination);
110+
destination
111111
}
112112
Action::Asm { target_index } => {
113113
let TerminatorKind::InlineAsm { ref mut targets, .. } = term.kind else {
114114
unreachable!()
115115
};
116-
targets[target_index] =
117-
new_block(source_info, is_cleanup, targets[target_index]);
116+
&mut targets[target_index]
118117
}
119-
}
118+
};
119+
*destination = new_block(source_info, is_cleanup, *destination);
120120
}
121121

122122
debug!("Broke {} N edges", new_blocks.len());

0 commit comments

Comments
 (0)