File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ pub trait HirDatabase: DefDatabase + Upcast<dyn DefDatabase> {
156156 & self ,
157157 projection : crate :: ProjectionTy ,
158158 env : Arc < crate :: TraitEnvironment > ,
159- ) -> Option < crate :: Ty > ;
159+ ) -> Ty ;
160160
161161 #[ salsa:: invoke( trait_solve_wait) ]
162162 #[ salsa:: transparent]
Original file line number Diff line number Diff line change @@ -69,10 +69,10 @@ pub(crate) fn normalize_projection_query(
6969 db : & dyn HirDatabase ,
7070 projection : ProjectionTy ,
7171 env : Arc < TraitEnvironment > ,
72- ) -> Option < Ty > {
73- let mut table = InferenceTable :: new ( db, env. clone ( ) ) ;
72+ ) -> Ty {
73+ let mut table = InferenceTable :: new ( db, env) ;
7474 let ty = table. normalize_projection_ty ( projection) ;
75- Some ( table. resolve_completely ( ty) )
75+ table. resolve_completely ( ty)
7676}
7777
7878/// Solve a trait goal using Chalk.
Original file line number Diff line number Diff line change @@ -2880,7 +2880,12 @@ impl Type {
28802880 } )
28812881 . build ( ) ;
28822882
2883- db. normalize_projection ( projection, self . env . clone ( ) ) . map ( |ty| self . derived ( ty) )
2883+ let ty = db. normalize_projection ( projection, self . env . clone ( ) ) ;
2884+ if ty. is_unknown ( ) {
2885+ None
2886+ } else {
2887+ Some ( self . derived ( ty) )
2888+ }
28842889 }
28852890
28862891 pub fn is_copy ( & self , db : & dyn HirDatabase ) -> bool {
You can’t perform that action at this time.
0 commit comments