@@ -407,11 +407,18 @@ impl<'a, D: SolverDelegate<Interner = I>, I: Interner> Canonicalizer<'a, D, I> {
407
407
"ty vid should have been resolved fully before canonicalization"
408
408
) ;
409
409
410
- CanonicalVarKind :: Ty ( CanonicalTyVarKind :: General (
411
- self . delegate
412
- . universe_of_ty ( vid)
413
- . unwrap_or_else ( || panic ! ( "ty var should have been resolved: {t:?}" ) ) ,
414
- ) )
410
+ match self . canonicalize_mode {
411
+ CanonicalizeMode :: Input { .. } => CanonicalVarKind :: Ty (
412
+ CanonicalTyVarKind :: General ( ty:: UniverseIndex :: ROOT ) ,
413
+ ) ,
414
+ CanonicalizeMode :: Response { .. } => {
415
+ CanonicalVarKind :: Ty ( CanonicalTyVarKind :: General (
416
+ self . delegate . universe_of_ty ( vid) . unwrap_or_else ( || {
417
+ panic ! ( "ty var should have been resolved: {t:?}" )
418
+ } ) ,
419
+ ) )
420
+ }
421
+ }
415
422
}
416
423
ty:: IntVar ( vid) => {
417
424
debug_assert_eq ! (
@@ -435,7 +442,7 @@ impl<'a, D: SolverDelegate<Interner = I>, I: Interner> Canonicalizer<'a, D, I> {
435
442
} ,
436
443
ty:: Placeholder ( placeholder) => match self . canonicalize_mode {
437
444
CanonicalizeMode :: Input { .. } => CanonicalVarKind :: PlaceholderTy (
438
- PlaceholderLike :: new_anon ( placeholder . universe ( ) , self . variables . len ( ) . into ( ) ) ,
445
+ PlaceholderLike :: new_anon ( ty :: UniverseIndex :: ROOT , self . variables . len ( ) . into ( ) ) ,
439
446
) ,
440
447
CanonicalizeMode :: Response { .. } => CanonicalVarKind :: PlaceholderTy ( placeholder) ,
441
448
} ,
@@ -588,13 +595,21 @@ impl<D: SolverDelegate<Interner = I>, I: Interner> TypeFolder<I> for Canonicaliz
588
595
c,
589
596
"const vid should have been resolved fully before canonicalization"
590
597
) ;
591
- CanonicalVarKind :: Const ( self . delegate . universe_of_ct ( vid) . unwrap ( ) )
598
+
599
+ match self . canonicalize_mode {
600
+ CanonicalizeMode :: Input { .. } => {
601
+ CanonicalVarKind :: Const ( ty:: UniverseIndex :: ROOT )
602
+ }
603
+ CanonicalizeMode :: Response { .. } => {
604
+ CanonicalVarKind :: Const ( self . delegate . universe_of_ct ( vid) . unwrap ( ) )
605
+ }
606
+ }
592
607
}
593
608
ty:: InferConst :: Fresh ( _) => todo ! ( ) ,
594
609
} ,
595
610
ty:: ConstKind :: Placeholder ( placeholder) => match self . canonicalize_mode {
596
611
CanonicalizeMode :: Input { .. } => CanonicalVarKind :: PlaceholderConst (
597
- PlaceholderLike :: new_anon ( placeholder . universe ( ) , self . variables . len ( ) . into ( ) ) ,
612
+ PlaceholderLike :: new_anon ( ty :: UniverseIndex :: ROOT , self . variables . len ( ) . into ( ) ) ,
598
613
) ,
599
614
CanonicalizeMode :: Response { .. } => {
600
615
CanonicalVarKind :: PlaceholderConst ( placeholder)
0 commit comments