Skip to content

Commit a71b808

Browse files
committed
Use Vec::split_off
1 parent c9c1346 commit a71b808

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_mir_transform/src/check_alignment.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ fn split_block(
111111

112112
// Drain every statement after this one and move the current terminator to a new basic block
113113
let new_block = BasicBlockData {
114-
statements: block_data.statements.drain(location.statement_index..).collect(),
114+
statements: block_data.statements.split_off(location.statement_index),
115115
terminator: block_data.terminator.take(),
116116
is_cleanup: block_data.is_cleanup,
117117
};

0 commit comments

Comments
 (0)