@@ -63,10 +63,9 @@ use hir_ty::{
6363 primitive:: UintTy ,
6464 subst_prefix,
6565 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 ,
7069} ;
7170use itertools:: Itertools ;
7271use nameres:: diagnostics:: DefDiagnosticKind ;
@@ -2880,28 +2879,8 @@ impl Type {
28802879 }
28812880 } )
28822881 . 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- ) ;
28952882
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) )
29052884 }
29062885
29072886 pub fn is_copy ( & self , db : & dyn HirDatabase ) -> bool {
0 commit comments