@@ -34,6 +34,8 @@ pub trait HirDatabase: DefDatabase + Upcast<dyn DefDatabase> {
34
34
#[ salsa:: invoke( crate :: infer:: infer_query) ]
35
35
fn infer_query ( & self , def : DefWithBodyId ) -> Arc < InferenceResult > ;
36
36
37
+ // region:mir
38
+
37
39
#[ salsa:: invoke( crate :: mir:: mir_body_query) ]
38
40
#[ salsa:: cycle( crate :: mir:: mir_body_recover) ]
39
41
fn mir_body ( & self , def : DefWithBodyId ) -> Result < Arc < MirBody > , MirLowerError > ;
@@ -61,20 +63,6 @@ pub trait HirDatabase: DefDatabase + Upcast<dyn DefDatabase> {
61
63
#[ salsa:: invoke( crate :: mir:: borrowck_query) ]
62
64
fn borrowck ( & self , def : DefWithBodyId ) -> Result < Arc < [ BorrowckResult ] > , MirLowerError > ;
63
65
64
- #[ salsa:: invoke( crate :: lower:: ty_query) ]
65
- #[ salsa:: cycle( crate :: lower:: ty_recover) ]
66
- fn ty ( & self , def : TyDefId ) -> Binders < Ty > ;
67
-
68
- #[ salsa:: invoke( crate :: lower:: value_ty_query) ]
69
- fn value_ty ( & self , def : ValueTyDefId ) -> Binders < Ty > ;
70
-
71
- #[ salsa:: invoke( crate :: lower:: impl_self_ty_query) ]
72
- #[ salsa:: cycle( crate :: lower:: impl_self_ty_recover) ]
73
- fn impl_self_ty ( & self , def : ImplId ) -> Binders < Ty > ;
74
-
75
- #[ salsa:: invoke( crate :: lower:: const_param_ty_query) ]
76
- fn const_param_ty ( & self , def : ConstParamId ) -> Ty ;
77
-
78
66
#[ salsa:: invoke( crate :: consteval:: const_eval_query) ]
79
67
#[ salsa:: cycle( crate :: consteval:: const_eval_recover) ]
80
68
fn const_eval (
@@ -92,6 +80,22 @@ pub trait HirDatabase: DefDatabase + Upcast<dyn DefDatabase> {
92
80
#[ salsa:: cycle( crate :: consteval:: const_eval_discriminant_recover) ]
93
81
fn const_eval_discriminant ( & self , def : EnumVariantId ) -> Result < i128 , ConstEvalError > ;
94
82
83
+ // endregion:mir
84
+
85
+ #[ salsa:: invoke( crate :: lower:: ty_query) ]
86
+ #[ salsa:: cycle( crate :: lower:: ty_recover) ]
87
+ fn ty ( & self , def : TyDefId ) -> Binders < Ty > ;
88
+
89
+ #[ salsa:: invoke( crate :: lower:: value_ty_query) ]
90
+ fn value_ty ( & self , def : ValueTyDefId ) -> Binders < Ty > ;
91
+
92
+ #[ salsa:: invoke( crate :: lower:: impl_self_ty_query) ]
93
+ #[ salsa:: cycle( crate :: lower:: impl_self_ty_recover) ]
94
+ fn impl_self_ty ( & self , def : ImplId ) -> Binders < Ty > ;
95
+
96
+ #[ salsa:: invoke( crate :: lower:: const_param_ty_query) ]
97
+ fn const_param_ty ( & self , def : ConstParamId ) -> Ty ;
98
+
95
99
#[ salsa:: invoke( crate :: lower:: impl_trait_query) ]
96
100
fn impl_trait ( & self , def : ImplId ) -> Option < Binders < TraitRef > > ;
97
101
@@ -158,7 +162,7 @@ pub trait HirDatabase: DefDatabase + Upcast<dyn DefDatabase> {
158
162
fn inherent_impls_in_crate ( & self , krate : CrateId ) -> Arc < InherentImpls > ;
159
163
160
164
#[ salsa:: invoke( InherentImpls :: inherent_impls_in_block_query) ]
161
- fn inherent_impls_in_block ( & self , block : BlockId ) -> Arc < InherentImpls > ;
165
+ fn inherent_impls_in_block ( & self , block : BlockId ) -> Option < Arc < InherentImpls > > ;
162
166
163
167
/// Collects all crates in the dependency graph that have impls for the
164
168
/// given fingerprint. This is only used for primitive types and types
@@ -175,7 +179,7 @@ pub trait HirDatabase: DefDatabase + Upcast<dyn DefDatabase> {
175
179
fn trait_impls_in_crate ( & self , krate : CrateId ) -> Arc < TraitImpls > ;
176
180
177
181
#[ salsa:: invoke( TraitImpls :: trait_impls_in_block_query) ]
178
- fn trait_impls_in_block ( & self , block : BlockId ) -> Arc < TraitImpls > ;
182
+ fn trait_impls_in_block ( & self , block : BlockId ) -> Option < Arc < TraitImpls > > ;
179
183
180
184
#[ salsa:: invoke( TraitImpls :: trait_impls_in_deps_query) ]
181
185
fn trait_impls_in_deps ( & self , krate : CrateId ) -> Arc < [ Arc < TraitImpls > ] > ;
0 commit comments