|
1 | 1 | use std::cmp::Ordering;
|
2 | 2 |
|
| 3 | +use crate::canonical::*; |
3 | 4 | use crate::fold::{TypeFoldable, TypeFolder, TypeSuperFoldable};
|
4 |
| -use crate::{canonical::*, ConstTy, IntoKind, Placeholder}; |
5 | 5 | use crate::{
|
6 |
| - BoundVar, ConstKind, DebruijnIndex, InferCtxtLike, Interner, RegionKind, TyKind, UniverseIndex, |
| 6 | + BoundVar, ConstKind, ConstTy, DebruijnIndex, InferCtxtLike, InferTy, Interner, IntoKind, |
| 7 | + Placeholder, RegionKind, TyKind, UniverseIndex, |
7 | 8 | };
|
8 | 9 |
|
9 | 10 | /// Whether we're canonicalizing a query input or the query response.
|
@@ -288,9 +289,16 @@ impl<Infcx: InferCtxtLike<Interner = I>, I: Interner> TypeFolder<I> for Canonica
|
288 | 289 | let Err(ui) = self.infcx.probe_ty_var(vid) else {
|
289 | 290 | panic!("ty var should have been resolved: {t}");
|
290 | 291 | }; */
|
291 |
| - CanonicalVarKind::Ty(CanonicalTyVarKind::General( |
292 |
| - self.infcx.universe_of_ty(i).unwrap(), |
293 |
| - )) |
| 292 | + match i { |
| 293 | + InferTy::TyVar(vid) => CanonicalVarKind::Ty(CanonicalTyVarKind::General( |
| 294 | + self.infcx.universe_of_ty(vid).unwrap(), |
| 295 | + )), |
| 296 | + InferTy::IntVar(_) => CanonicalVarKind::Ty(CanonicalTyVarKind::Int), |
| 297 | + InferTy::FloatVar(_) => CanonicalVarKind::Ty(CanonicalTyVarKind::Float), |
| 298 | + InferTy::FreshTy(_) | InferTy::FreshIntTy(_) | InferTy::FreshFloatTy(_) => { |
| 299 | + todo!() |
| 300 | + } |
| 301 | + } |
294 | 302 | }
|
295 | 303 | TyKind::Placeholder(placeholder) => match self.canonicalize_mode {
|
296 | 304 | CanonicalizeMode::Input => CanonicalVarKind::PlaceholderTy(Placeholder::new(
|
@@ -348,6 +356,7 @@ impl<Infcx: InferCtxtLike<Interner = I>, I: Interner> TypeFolder<I> for Canonica
|
348 | 356 | I::Const: TypeSuperFoldable<I>,
|
349 | 357 | {
|
350 | 358 | let kind = match c.kind() {
|
| 359 | + // TODO: This will not canonicalize effect vars until InferConst is uplifted. |
351 | 360 | ConstKind::Infer(i) => {
|
352 | 361 | /* TODO: assert_eq!(
|
353 | 362 | self.infcx.root_const_var(vid),
|
|
0 commit comments