Skip to content

Commit 0eeebe1

Browse files
committed
Ensure that we don't skip the last statement.
1 parent bbcace5 commit 0eeebe1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustc_mir/dataflow/impls/borrows.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ fn precompute_borrows_out_of_scope<'a, 'tcx>(
7070
}
7171

7272
let bb_data = &mir[location.block];
73-
// If we are on the last statement, then check the terminator
73+
// If we are past the last statement, then check the terminator
7474
// to determine which location to proceed to.
75-
if location.statement_index == bb_data.statements.len() - 1 {
75+
if location.statement_index == bb_data.statements.len() {
7676
if let Some(ref terminator) = bb_data.terminator {
7777
match terminator.kind {
7878
TerminatorKind::Goto { target } |

0 commit comments

Comments
 (0)