From 5d121cdb45f5199828ed64a2ca01a74998e023ad Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Mon, 1 Mar 2021 14:24:00 +0100 Subject: Introduce Ty::Alias --- crates/hir/src/code_model.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/hir') diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs index 351ba75ff..00b0dc082 100644 --- a/crates/hir/src/code_model.rs +++ b/crates/hir/src/code_model.rs @@ -31,7 +31,7 @@ use hir_ty::{ display::{write_bounds_like_dyn_trait_with_prefix, HirDisplayError, HirFormatter}, method_resolution, traits::{FnTrait, Solution, SolutionVariables}, - BoundVar, CallableDefId, CallableSig, Canonical, DebruijnIndex, GenericPredicate, + AliasTy, BoundVar, CallableDefId, CallableSig, Canonical, DebruijnIndex, GenericPredicate, InEnvironment, Obligation, ProjectionPredicate, ProjectionTy, Scalar, Substs, TraitEnvironment, Ty, TyDefId, TyVariableKind, }; @@ -1648,7 +1648,7 @@ impl Type { .build(); let predicate = ProjectionPredicate { projection_ty: ProjectionTy { associated_ty: alias.id, parameters: subst }, - ty: Ty::Bound(BoundVar::new(DebruijnIndex::INNERMOST, 0)), + ty: Ty::BoundVar(BoundVar::new(DebruijnIndex::INNERMOST, 0)), }; let goal = Canonical { value: InEnvironment::new( @@ -1709,7 +1709,7 @@ impl Type { } pub fn is_raw_ptr(&self) -> bool { - matches!(&self.ty.value, Ty::RawPtr(..)) + matches!(&self.ty.value, Ty::Raw(..)) } pub fn contains_unknown(&self) -> bool { @@ -1937,7 +1937,7 @@ impl Type { walk_bounds(db, &type_.derived(ty.clone()), &bounds, cb); } } - Ty::Opaque(opaque_ty) => { + Ty::Alias(AliasTy::Opaque(opaque_ty)) => { if let Some(bounds) = ty.impl_trait_bounds(db) { walk_bounds(db, &type_.derived(ty.clone()), &bounds, cb); } -- cgit v1.2.3