Skip to content

Commit 29081f9

Browse files
authored
Rollup merge of #89823 - jackh726:project-overflow, r=oli-obk
Switch order of terms to prevent overflow Fixes #89639 r? ``@pnkfelix``
2 parents d177791 + 9855e7d commit 29081f9

File tree

1 file changed

+1
-1
lines changed
  • compiler/rustc_trait_selection/src/traits

1 file changed

+1
-1
lines changed

compiler/rustc_trait_selection/src/traits/project.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ impl<'me, 'tcx> BoundVarReplacer<'me, 'tcx> {
558558
fn universe_for(&mut self, debruijn: ty::DebruijnIndex) -> ty::UniverseIndex {
559559
let infcx = self.infcx;
560560
let index =
561-
self.universe_indices.len() - debruijn.as_usize() + self.current_index.as_usize() - 1;
561+
self.universe_indices.len() + self.current_index.as_usize() - debruijn.as_usize() - 1;
562562
let universe = self.universe_indices[index].unwrap_or_else(|| {
563563
for i in self.universe_indices.iter_mut().take(index + 1) {
564564
*i = i.or_else(|| Some(infcx.create_next_universe()))

0 commit comments

Comments
 (0)