Skip to content

Commit ab627aa

Browse files
committed
Fix off-by-one
1 parent f3f865e commit ab627aa

File tree

1 file changed

+2
-2
lines changed
  • compiler/rustc_borrowck/src/region_infer

1 file changed

+2
-2
lines changed

compiler/rustc_borrowck/src/region_infer/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2046,7 +2046,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
20462046
// we still want to screen for an "interesting" point to
20472047
// highlight (e.g., a call site or something).
20482048
let target_scc = self.constraint_sccs.scc(target_region);
2049-
let mut range = 0..path.len();
2049+
let mut range = 0..categorized_path.len();
20502050

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

2165-
categorized_path.shift_remove_index(0).unwrap()
2165+
return categorized_path[0].clone();
21662166
}
21672167

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

0 commit comments

Comments
 (0)