Skip to content

Commit

Permalink
Fix off-by-one
Browse files Browse the repository at this point in the history
  • Loading branch information
pierwill committed Dec 22, 2021
1 parent f3f865e commit ab627aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/rustc_borrowck/src/region_infer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2046,7 +2046,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
// we still want to screen for an "interesting" point to
// highlight (e.g., a call site or something).
let target_scc = self.constraint_sccs.scc(target_region);
let mut range = 0..path.len();
let mut range = 0..categorized_path.len();

// As noted above, when reporting an error, there is typically a chain of constraints
// leading from some "source" region which must outlive some "target" region.
Expand Down Expand Up @@ -2162,7 +2162,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
return categorized_path[i].clone();
}

categorized_path.shift_remove_index(0).unwrap()
return categorized_path[0].clone();
}

crate fn universe_info(&self, universe: ty::UniverseIndex) -> UniverseInfo<'tcx> {
Expand Down

0 comments on commit ab627aa

Please sign in to comment.