File tree 3 files changed +10
-5
lines changed
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> {
156
156
& self ,
157
157
projection : crate :: ProjectionTy ,
158
158
env : Arc < crate :: TraitEnvironment > ,
159
- ) -> Option < crate :: Ty > ;
159
+ ) -> Ty ;
160
160
161
161
#[ salsa:: invoke( trait_solve_wait) ]
162
162
#[ salsa:: transparent]
Original file line number Diff line number Diff line change @@ -69,10 +69,10 @@ pub(crate) fn normalize_projection_query(
69
69
db : & dyn HirDatabase ,
70
70
projection : ProjectionTy ,
71
71
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) ;
74
74
let ty = table. normalize_projection_ty ( projection) ;
75
- Some ( table. resolve_completely ( ty) )
75
+ table. resolve_completely ( ty)
76
76
}
77
77
78
78
/// Solve a trait goal using Chalk.
Original file line number Diff line number Diff line change @@ -2880,7 +2880,12 @@ impl Type {
2880
2880
} )
2881
2881
. build ( ) ;
2882
2882
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
+ }
2884
2889
}
2885
2890
2886
2891
pub fn is_copy ( & self , db : & dyn HirDatabase ) -> bool {
You can’t perform that action at this time.
0 commit comments