1
1
//! The home of `HirDatabase`, which is the Salsa database containing all the
2
2
//! type inference-related queries.
3
3
4
- use std:: sync;
5
-
6
4
use base_db:: Crate ;
7
5
use hir_def:: {
8
6
AdtId , BlockId , CallableDefId , ConstParamId , DefWithBodyId , EnumVariantId , FunctionId ,
@@ -94,16 +92,20 @@ pub trait HirDatabase: DefDatabase + std::fmt::Debug {
94
92
95
93
#[ salsa:: invoke( crate :: layout:: layout_of_adt_query) ]
96
94
#[ salsa:: cycle( cycle_result = crate :: layout:: layout_of_adt_cycle_result) ]
97
- fn layout_of_adt (
98
- & self ,
95
+ fn layout_of_adt < ' db > (
96
+ & ' db self ,
99
97
def : AdtId ,
100
- subst : Substitution ,
101
- env : Arc < TraitEnvironment > ,
98
+ args : crate :: next_solver :: GenericArgs < ' db > ,
99
+ trait_env : Arc < TraitEnvironment > ,
102
100
) -> Result < Arc < Layout > , LayoutError > ;
103
101
104
102
#[ salsa:: invoke( crate :: layout:: layout_of_ty_query) ]
105
103
#[ salsa:: cycle( cycle_result = crate :: layout:: layout_of_ty_cycle_result) ]
106
- fn layout_of_ty ( & self , ty : Ty , env : Arc < TraitEnvironment > ) -> Result < Arc < Layout > , LayoutError > ;
104
+ fn layout_of_ty < ' db > (
105
+ & ' db self ,
106
+ ty : crate :: next_solver:: Ty < ' db > ,
107
+ env : Arc < TraitEnvironment > ,
108
+ ) -> Result < Arc < Layout > , LayoutError > ;
107
109
108
110
#[ salsa:: invoke( crate :: layout:: target_data_layout_query) ]
109
111
fn target_data_layout ( & self , krate : Crate ) -> Result < Arc < TargetDataLayout > , Arc < str > > ;
@@ -179,16 +181,6 @@ pub trait HirDatabase: DefDatabase + std::fmt::Debug {
179
181
#[ salsa:: invoke( crate :: lower:: generic_predicates_query) ]
180
182
fn generic_predicates ( & self , def : GenericDefId ) -> GenericPredicates ;
181
183
182
- #[ salsa:: invoke( crate :: lower:: generic_predicates_without_parent_with_diagnostics_query) ]
183
- fn generic_predicates_without_parent_with_diagnostics (
184
- & self ,
185
- def : GenericDefId ,
186
- ) -> ( GenericPredicates , Diagnostics ) ;
187
-
188
- #[ salsa:: invoke( crate :: lower:: generic_predicates_without_parent_query) ]
189
- #[ salsa:: transparent]
190
- fn generic_predicates_without_parent ( & self , def : GenericDefId ) -> GenericPredicates ;
191
-
192
184
#[ salsa:: invoke( crate :: lower:: trait_environment_for_body_query) ]
193
185
#[ salsa:: transparent]
194
186
fn trait_environment_for_body ( & self , def : DefWithBodyId ) -> Arc < TraitEnvironment > ;
@@ -246,26 +238,6 @@ pub trait HirDatabase: DefDatabase + std::fmt::Debug {
246
238
#[ salsa:: interned]
247
239
fn intern_coroutine ( & self , id : InternedCoroutine ) -> InternedCoroutineId ;
248
240
249
- #[ salsa:: invoke( chalk_db:: associated_ty_data_query) ]
250
- fn associated_ty_data ( & self , id : TypeAliasId ) -> sync:: Arc < chalk_db:: AssociatedTyDatum > ;
251
-
252
- #[ salsa:: invoke( chalk_db:: trait_datum_query) ]
253
- fn trait_datum (
254
- & self ,
255
- krate : Crate ,
256
- trait_id : chalk_db:: TraitId ,
257
- ) -> sync:: Arc < chalk_db:: TraitDatum > ;
258
-
259
- #[ salsa:: invoke( chalk_db:: adt_datum_query) ]
260
- fn adt_datum ( & self , krate : Crate , struct_id : chalk_db:: AdtId ) -> sync:: Arc < chalk_db:: AdtDatum > ;
261
-
262
- #[ salsa:: invoke( chalk_db:: impl_datum_query) ]
263
- fn impl_datum ( & self , krate : Crate , impl_id : chalk_db:: ImplId )
264
- -> sync:: Arc < chalk_db:: ImplDatum > ;
265
-
266
- #[ salsa:: invoke( chalk_db:: fn_def_datum_query) ]
267
- fn fn_def_datum ( & self , fn_def_id : CallableDefId ) -> sync:: Arc < chalk_db:: FnDefDatum > ;
268
-
269
241
#[ salsa:: invoke( chalk_db:: fn_def_variance_query) ]
270
242
fn fn_def_variance ( & self , fn_def_id : CallableDefId ) -> chalk_db:: Variances ;
271
243
@@ -280,13 +252,6 @@ pub trait HirDatabase: DefDatabase + std::fmt::Debug {
280
252
) ]
281
253
fn variances_of ( & self , def : GenericDefId ) -> Option < Arc < [ crate :: variance:: Variance ] > > ;
282
254
283
- #[ salsa:: invoke( chalk_db:: associated_ty_value_query) ]
284
- fn associated_ty_value (
285
- & self ,
286
- krate : Crate ,
287
- id : chalk_db:: AssociatedTyValueId ,
288
- ) -> sync:: Arc < chalk_db:: AssociatedTyValue > ;
289
-
290
255
#[ salsa:: invoke( crate :: traits:: normalize_projection_query) ]
291
256
#[ salsa:: transparent]
292
257
fn normalize_projection (
@@ -310,23 +275,6 @@ pub trait HirDatabase: DefDatabase + std::fmt::Debug {
310
275
311
276
// next trait solver
312
277
313
- #[ salsa:: invoke( crate :: layout:: layout_of_adt_ns_query) ]
314
- #[ salsa:: cycle( cycle_result = crate :: layout:: layout_of_adt_ns_cycle_result) ]
315
- fn layout_of_adt_ns < ' db > (
316
- & ' db self ,
317
- def : AdtId ,
318
- args : crate :: next_solver:: GenericArgs < ' db > ,
319
- trait_env : Arc < TraitEnvironment > ,
320
- ) -> Result < Arc < Layout > , LayoutError > ;
321
-
322
- #[ salsa:: invoke( crate :: layout:: layout_of_ty_ns_query) ]
323
- #[ salsa:: cycle( cycle_result = crate :: layout:: layout_of_ty_ns_cycle_result) ]
324
- fn layout_of_ty_ns < ' db > (
325
- & ' db self ,
326
- ty : crate :: next_solver:: Ty < ' db > ,
327
- env : Arc < TraitEnvironment > ,
328
- ) -> Result < Arc < Layout > , LayoutError > ;
329
-
330
278
#[ salsa:: invoke( crate :: lower_nextsolver:: ty_query) ]
331
279
#[ salsa:: transparent]
332
280
fn ty_ns < ' db > (
0 commit comments