Update compiler/rustc_infer/src/infer/canonical/mod.rs

This commit is contained in:
Niko Matsakis 2022-10-10 16:51:36 -04:00 committed by GitHub
parent f87953f01a
commit 70200ac190
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -63,6 +63,9 @@ impl<'cx, 'tcx> InferCtxt<'cx, 'tcx> {
// in them, so this code has no effect, but it is looking
// forward to the day when we *do* want to carry universes
// through into queries.
//
// Instantiate the root-universe content into the current universe,
// and create fresh universes for the higher universes.
let universes: IndexVec<ty::UniverseIndex, _> = std::iter::once(self.universe())
.chain((1..=canonical.max_universe.as_u32()).map(|_| self.create_next_universe()))
.collect();