@@ -63,10 +63,9 @@ use hir_ty::{
63
63
primitive:: UintTy ,
64
64
subst_prefix,
65
65
traits:: FnTrait ,
66
- AliasEq , AliasTy , BoundVar , CallableDefId , CallableSig , Canonical , CanonicalVarKinds , Cast ,
67
- ClosureId , DebruijnIndex , GenericArgData , InEnvironment , Interner , ParamKind ,
68
- QuantifiedWhereClause , Scalar , Solution , Substitution , TraitEnvironment , TraitRefExt , Ty ,
69
- TyBuilder , TyDefId , TyExt , TyKind , TyVariableKind , WhereClause ,
66
+ AliasTy , CallableDefId , CallableSig , Canonical , CanonicalVarKinds , Cast , ClosureId ,
67
+ GenericArgData , Interner , ParamKind , QuantifiedWhereClause , Scalar , Substitution ,
68
+ TraitEnvironment , TraitRefExt , Ty , TyBuilder , TyDefId , TyExt , TyKind , WhereClause ,
70
69
} ;
71
70
use itertools:: Itertools ;
72
71
use nameres:: diagnostics:: DefDiagnosticKind ;
@@ -2880,28 +2879,8 @@ impl Type {
2880
2879
}
2881
2880
} )
2882
2881
. build ( ) ;
2883
- let goal = hir_ty:: make_canonical (
2884
- InEnvironment :: new (
2885
- & self . env . env ,
2886
- AliasEq {
2887
- alias : AliasTy :: Projection ( projection) ,
2888
- ty : TyKind :: BoundVar ( BoundVar :: new ( DebruijnIndex :: INNERMOST , 0 ) )
2889
- . intern ( Interner ) ,
2890
- }
2891
- . cast ( Interner ) ,
2892
- ) ,
2893
- [ TyVariableKind :: General ] . into_iter ( ) ,
2894
- ) ;
2895
2882
2896
- match db. trait_solve ( self . env . krate , goal) ? {
2897
- Solution :: Unique ( s) => s
2898
- . value
2899
- . subst
2900
- . as_slice ( Interner )
2901
- . first ( )
2902
- . map ( |ty| self . derived ( ty. assert_ty_ref ( Interner ) . clone ( ) ) ) ,
2903
- Solution :: Ambig ( _) => None ,
2904
- }
2883
+ db. normalize_projection ( projection, self . env . clone ( ) ) . map ( |ty| self . derived ( ty) )
2905
2884
}
2906
2885
2907
2886
pub fn is_copy ( & self , db : & dyn HirDatabase ) -> bool {
0 commit comments