Skip to content

Commit

Permalink
fix off by one error
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis committed May 29, 2018
1 parent 948f77c commit 3a9134d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustc_mir/dataflow/impls/borrows.rs
Expand Up @@ -88,7 +88,7 @@ fn precompute_borrows_out_of_scope<'a, 'tcx>(
let bb_data = &mir[location.block];
// If this is the last statement in the block, then add the
// terminator successors next.
if location.statement_index == bb_data.statements.len() - 1 {
if location.statement_index == bb_data.statements.len() {
// Add successors to locations to visit, if not visited before.
if let Some(ref terminator) = bb_data.terminator {
for block in terminator.successors() {
Expand Down

0 comments on commit 3a9134d

Please sign in to comment.