Rollup merge of #89823 - jackh726:project-overflow, r=oli-obk
Switch order of terms to prevent overflow Fixes #89639 r? ``@pnkfelix``
This commit is contained in:
commit
29081f95e9
1 changed files with 1 additions and 1 deletions
|
@ -558,7 +558,7 @@ impl<'me, 'tcx> BoundVarReplacer<'me, 'tcx> {
|
||||||
fn universe_for(&mut self, debruijn: ty::DebruijnIndex) -> ty::UniverseIndex {
|
fn universe_for(&mut self, debruijn: ty::DebruijnIndex) -> ty::UniverseIndex {
|
||||||
let infcx = self.infcx;
|
let infcx = self.infcx;
|
||||||
let index =
|
let index =
|
||||||
self.universe_indices.len() - debruijn.as_usize() + self.current_index.as_usize() - 1;
|
self.universe_indices.len() + self.current_index.as_usize() - debruijn.as_usize() - 1;
|
||||||
let universe = self.universe_indices[index].unwrap_or_else(|| {
|
let universe = self.universe_indices[index].unwrap_or_else(|| {
|
||||||
for i in self.universe_indices.iter_mut().take(index + 1) {
|
for i in self.universe_indices.iter_mut().take(index + 1) {
|
||||||
*i = i.or_else(|| Some(infcx.create_next_universe()))
|
*i = i.or_else(|| Some(infcx.create_next_universe()))
|
||||||
|
|
Loading…
Add table
Reference in a new issue