@@ -16,8 +16,8 @@ use smallvec::SmallVec;
16
16
use triomphe:: Arc ;
17
17
18
18
use crate :: {
19
- Binders , Const , ImplTraitId , ImplTraits , InferenceResult , PolyFnSig , Substitution ,
20
- TraitEnvironment , TraitRef , Ty , TyDefId , ValueTyDefId , chalk_db,
19
+ Binders , Const , ImplTraitId , ImplTraits , InferenceResult , Substitution , TraitEnvironment ,
20
+ TraitRef , Ty , TyDefId , ValueTyDefId , chalk_db,
21
21
consteval:: ConstEvalError ,
22
22
drop:: DropGlue ,
23
23
dyn_compatibility:: DynCompatibilityViolation ,
@@ -114,55 +114,88 @@ pub trait HirDatabase: DefDatabase + std::fmt::Debug {
114
114
#[ salsa:: invoke( crate :: dyn_compatibility:: dyn_compatibility_of_trait_query) ]
115
115
fn dyn_compatibility_of_trait ( & self , trait_ : TraitId ) -> Option < DynCompatibilityViolation > ;
116
116
117
- #[ salsa:: invoke( crate :: lower :: ty_query) ]
117
+ #[ salsa:: invoke( crate :: lower_nextsolver :: ty_query) ]
118
118
#[ salsa:: transparent]
119
- fn ty ( & self , def : TyDefId ) -> Binders < Ty > ;
119
+ fn ty < ' db > (
120
+ & ' db self ,
121
+ def : TyDefId ,
122
+ ) -> crate :: next_solver:: EarlyBinder < ' db , crate :: next_solver:: Ty < ' db > > ;
120
123
121
- #[ salsa:: invoke( crate :: lower:: type_for_type_alias_with_diagnostics_query) ]
122
- #[ salsa:: cycle( cycle_result = crate :: lower:: type_for_type_alias_with_diagnostics_cycle_result) ]
123
- fn type_for_type_alias_with_diagnostics ( & self , def : TypeAliasId ) -> ( Binders < Ty > , Diagnostics ) ;
124
+ #[ salsa:: invoke( crate :: lower_nextsolver:: type_for_type_alias_with_diagnostics_query) ]
125
+ #[ salsa:: cycle( cycle_result = crate :: lower_nextsolver:: type_for_type_alias_with_diagnostics_cycle_result) ]
126
+ fn type_for_type_alias_with_diagnostics < ' db > (
127
+ & ' db self ,
128
+ def : TypeAliasId ,
129
+ ) -> ( crate :: next_solver:: EarlyBinder < ' db , crate :: next_solver:: Ty < ' db > > , Diagnostics ) ;
124
130
125
131
/// Returns the type of the value of the given constant, or `None` if the `ValueTyDefId` is
126
132
/// a `StructId` or `EnumVariantId` with a record constructor.
127
- #[ salsa:: invoke( crate :: lower:: value_ty_query) ]
128
- fn value_ty ( & self , def : ValueTyDefId ) -> Option < Binders < Ty > > ;
133
+ #[ salsa:: invoke( crate :: lower_nextsolver:: value_ty_query) ]
134
+ fn value_ty < ' db > (
135
+ & ' db self ,
136
+ def : ValueTyDefId ,
137
+ ) -> Option < crate :: next_solver:: EarlyBinder < ' db , crate :: next_solver:: Ty < ' db > > > ;
129
138
130
- #[ salsa:: invoke( crate :: lower:: impl_self_ty_with_diagnostics_query) ]
131
- #[ salsa:: cycle( cycle_result = crate :: lower:: impl_self_ty_with_diagnostics_cycle_result) ]
132
- fn impl_self_ty_with_diagnostics ( & self , def : ImplId ) -> ( Binders < Ty > , Diagnostics ) ;
139
+ #[ salsa:: invoke( crate :: lower_nextsolver:: impl_self_ty_with_diagnostics_query) ]
140
+ #[ salsa:: cycle( cycle_result = crate :: lower_nextsolver:: impl_self_ty_with_diagnostics_cycle_result) ]
141
+ fn impl_self_ty_with_diagnostics < ' db > (
142
+ & ' db self ,
143
+ def : ImplId ,
144
+ ) -> ( crate :: next_solver:: EarlyBinder < ' db , crate :: next_solver:: Ty < ' db > > , Diagnostics ) ;
133
145
134
146
#[ salsa:: invoke( crate :: lower:: impl_self_ty_query) ]
135
147
#[ salsa:: transparent]
136
148
fn impl_self_ty ( & self , def : ImplId ) -> Binders < Ty > ;
137
149
138
150
// FIXME: Make this a non-interned query.
139
- #[ salsa:: invoke_interned( crate :: lower:: const_param_ty_with_diagnostics_query) ]
140
- #[ salsa:: cycle( cycle_result = crate :: lower:: const_param_ty_with_diagnostics_cycle_result) ]
141
- fn const_param_ty_with_diagnostics ( & self , def : ConstParamId ) -> ( Ty , Diagnostics ) ;
151
+ #[ salsa:: invoke_interned( crate :: lower_nextsolver:: const_param_ty_with_diagnostics_query) ]
152
+ #[ salsa:: cycle( cycle_result = crate :: lower_nextsolver:: const_param_ty_with_diagnostics_cycle_result) ]
153
+ fn const_param_ty_with_diagnostics < ' db > (
154
+ & ' db self ,
155
+ def : ConstParamId ,
156
+ ) -> ( crate :: next_solver:: Ty < ' db > , Diagnostics ) ;
142
157
143
- #[ salsa:: invoke( crate :: lower:: const_param_ty_query) ]
144
- #[ salsa:: transparent]
158
+ // FIXME: Make this a non-interned query.
159
+ #[ salsa:: invoke_interned( crate :: lower:: const_param_ty_query) ]
160
+ #[ salsa:: cycle( cycle_result = crate :: lower:: const_param_ty_cycle_result) ]
145
161
fn const_param_ty ( & self , def : ConstParamId ) -> Ty ;
146
162
147
- #[ salsa:: invoke( crate :: lower:: impl_trait_with_diagnostics_query) ]
148
- fn impl_trait_with_diagnostics ( & self , def : ImplId ) -> Option < ( Binders < TraitRef > , Diagnostics ) > ;
163
+ #[ salsa:: invoke( crate :: lower_nextsolver:: impl_trait_with_diagnostics_query) ]
164
+ fn impl_trait_with_diagnostics < ' db > (
165
+ & ' db self ,
166
+ def : ImplId ,
167
+ ) -> Option < (
168
+ crate :: next_solver:: EarlyBinder < ' db , crate :: next_solver:: TraitRef < ' db > > ,
169
+ Diagnostics ,
170
+ ) > ;
149
171
150
172
#[ salsa:: invoke( crate :: lower:: impl_trait_query) ]
151
173
#[ salsa:: transparent]
152
174
fn impl_trait ( & self , def : ImplId ) -> Option < Binders < TraitRef > > ;
153
175
154
- #[ salsa:: invoke( crate :: lower :: field_types_with_diagnostics_query) ]
155
- fn field_types_with_diagnostics (
156
- & self ,
176
+ #[ salsa:: invoke( crate :: lower_nextsolver :: field_types_with_diagnostics_query) ]
177
+ fn field_types_with_diagnostics < ' db > (
178
+ & ' db self ,
157
179
var : VariantId ,
158
- ) -> ( Arc < ArenaMap < LocalFieldId , Binders < Ty > > > , Diagnostics ) ;
180
+ ) -> (
181
+ Arc <
182
+ ArenaMap <
183
+ LocalFieldId ,
184
+ crate :: next_solver:: EarlyBinder < ' db , crate :: next_solver:: Ty < ' db > > ,
185
+ > ,
186
+ > ,
187
+ Diagnostics ,
188
+ ) ;
159
189
160
190
#[ salsa:: invoke( crate :: lower:: field_types_query) ]
161
191
#[ salsa:: transparent]
162
192
fn field_types ( & self , var : VariantId ) -> Arc < ArenaMap < LocalFieldId , Binders < Ty > > > ;
163
193
164
- #[ salsa:: invoke( crate :: lower:: callable_item_signature_query) ]
165
- fn callable_item_signature ( & self , def : CallableDefId ) -> PolyFnSig ;
194
+ #[ salsa:: invoke( crate :: lower_nextsolver:: callable_item_signature_query) ]
195
+ fn callable_item_signature < ' db > (
196
+ & ' db self ,
197
+ def : CallableDefId ,
198
+ ) -> crate :: next_solver:: EarlyBinder < ' db , crate :: next_solver:: PolyFnSig < ' db > > ;
166
199
167
200
#[ salsa:: invoke( crate :: lower:: return_type_impl_traits) ]
168
201
fn return_type_impl_traits ( & self , def : FunctionId ) -> Option < Arc < Binders < ImplTraits > > > ;
@@ -182,6 +215,21 @@ pub trait HirDatabase: DefDatabase + std::fmt::Debug {
182
215
#[ salsa:: invoke( crate :: lower:: generic_predicates_query) ]
183
216
fn generic_predicates ( & self , def : GenericDefId ) -> GenericPredicates ;
184
217
218
+ #[ salsa:: invoke(
219
+ crate :: lower_nextsolver:: generic_predicates_without_parent_with_diagnostics_query
220
+ ) ]
221
+ fn generic_predicates_without_parent_with_diagnostics < ' db > (
222
+ & ' db self ,
223
+ def : GenericDefId ,
224
+ ) -> ( crate :: lower_nextsolver:: GenericPredicates < ' db > , Diagnostics ) ;
225
+
226
+ #[ salsa:: invoke( crate :: lower_nextsolver:: generic_predicates_without_parent_query) ]
227
+ #[ salsa:: transparent]
228
+ fn generic_predicates_without_parent < ' db > (
229
+ & ' db self ,
230
+ def : GenericDefId ,
231
+ ) -> crate :: lower_nextsolver:: GenericPredicates < ' db > ;
232
+
185
233
#[ salsa:: invoke( crate :: lower_nextsolver:: trait_environment_for_body_query) ]
186
234
#[ salsa:: transparent]
187
235
fn trait_environment_for_body < ' db > ( & ' db self , def : DefWithBodyId )
@@ -277,83 +325,24 @@ pub trait HirDatabase: DefDatabase + std::fmt::Debug {
277
325
278
326
// next trait solver
279
327
280
- #[ salsa:: invoke( crate :: lower_nextsolver:: ty_query) ]
281
- #[ salsa:: transparent]
282
- fn ty_ns < ' db > (
283
- & ' db self ,
284
- def : TyDefId ,
285
- ) -> crate :: next_solver:: EarlyBinder < ' db , crate :: next_solver:: Ty < ' db > > ;
286
-
287
- /// Returns the type of the value of the given constant, or `None` if the `ValueTyDefId` is
288
- /// a `StructId` or `EnumVariantId` with a record constructor.
289
- #[ salsa:: invoke( crate :: lower_nextsolver:: value_ty_query) ]
290
- fn value_ty_ns < ' db > (
291
- & ' db self ,
292
- def : ValueTyDefId ,
293
- ) -> Option < crate :: next_solver:: EarlyBinder < ' db , crate :: next_solver:: Ty < ' db > > > ;
294
-
295
- #[ salsa:: invoke( crate :: lower_nextsolver:: type_for_type_alias_with_diagnostics_query) ]
296
- #[ salsa:: cycle( cycle_result = crate :: lower_nextsolver:: type_for_type_alias_with_diagnostics_cycle_result) ]
297
- fn type_for_type_alias_with_diagnostics_ns < ' db > (
298
- & ' db self ,
299
- def : TypeAliasId ,
300
- ) -> ( crate :: next_solver:: EarlyBinder < ' db , crate :: next_solver:: Ty < ' db > > , Diagnostics ) ;
301
-
302
- #[ salsa:: invoke( crate :: lower_nextsolver:: impl_self_ty_with_diagnostics_query) ]
303
- #[ salsa:: cycle( cycle_result = crate :: lower_nextsolver:: impl_self_ty_with_diagnostics_cycle_result) ]
304
- fn impl_self_ty_with_diagnostics_ns < ' db > (
305
- & ' db self ,
306
- def : ImplId ,
307
- ) -> ( crate :: next_solver:: EarlyBinder < ' db , crate :: next_solver:: Ty < ' db > > , Diagnostics ) ;
308
-
309
328
#[ salsa:: invoke( crate :: lower_nextsolver:: impl_self_ty_query) ]
310
329
#[ salsa:: transparent]
311
330
fn impl_self_ty_ns < ' db > (
312
331
& ' db self ,
313
332
def : ImplId ,
314
333
) -> crate :: next_solver:: EarlyBinder < ' db , crate :: next_solver:: Ty < ' db > > ;
315
334
316
- // FIXME: Make this a non-interned query.
317
- #[ salsa:: invoke_interned( crate :: lower_nextsolver:: const_param_ty_with_diagnostics_query) ]
318
- fn const_param_ty_with_diagnostics_ns < ' db > (
319
- & ' db self ,
320
- def : ConstParamId ,
321
- ) -> ( crate :: next_solver:: Ty < ' db > , Diagnostics ) ;
322
-
323
335
#[ salsa:: invoke( crate :: lower_nextsolver:: const_param_ty_query) ]
324
336
#[ salsa:: transparent]
325
337
fn const_param_ty_ns < ' db > ( & ' db self , def : ConstParamId ) -> crate :: next_solver:: Ty < ' db > ;
326
338
327
- #[ salsa:: invoke( crate :: lower_nextsolver:: impl_trait_with_diagnostics_query) ]
328
- fn impl_trait_with_diagnostics_ns < ' db > (
329
- & ' db self ,
330
- def : ImplId ,
331
- ) -> Option < (
332
- crate :: next_solver:: EarlyBinder < ' db , crate :: next_solver:: TraitRef < ' db > > ,
333
- Diagnostics ,
334
- ) > ;
335
-
336
339
#[ salsa:: invoke( crate :: lower_nextsolver:: impl_trait_query) ]
337
340
#[ salsa:: transparent]
338
341
fn impl_trait_ns < ' db > (
339
342
& ' db self ,
340
343
def : ImplId ,
341
344
) -> Option < crate :: next_solver:: EarlyBinder < ' db , crate :: next_solver:: TraitRef < ' db > > > ;
342
345
343
- #[ salsa:: invoke( crate :: lower_nextsolver:: field_types_with_diagnostics_query) ]
344
- fn field_types_with_diagnostics_ns < ' db > (
345
- & ' db self ,
346
- var : VariantId ,
347
- ) -> (
348
- Arc <
349
- ArenaMap <
350
- LocalFieldId ,
351
- crate :: next_solver:: EarlyBinder < ' db , crate :: next_solver:: Ty < ' db > > ,
352
- > ,
353
- > ,
354
- Diagnostics ,
355
- ) ;
356
-
357
346
#[ salsa:: invoke( crate :: lower_nextsolver:: field_types_query) ]
358
347
#[ salsa:: transparent]
359
348
fn field_types_ns < ' db > (
@@ -363,12 +352,6 @@ pub trait HirDatabase: DefDatabase + std::fmt::Debug {
363
352
ArenaMap < LocalFieldId , crate :: next_solver:: EarlyBinder < ' db , crate :: next_solver:: Ty < ' db > > > ,
364
353
> ;
365
354
366
- #[ salsa:: invoke( crate :: lower_nextsolver:: callable_item_signature_query) ]
367
- fn callable_item_signature_ns < ' db > (
368
- & ' db self ,
369
- def : CallableDefId ,
370
- ) -> crate :: next_solver:: EarlyBinder < ' db , crate :: next_solver:: PolyFnSig < ' db > > ;
371
-
372
355
#[ salsa:: invoke( crate :: lower_nextsolver:: return_type_impl_traits) ]
373
356
fn return_type_impl_traits_ns < ' db > (
374
357
& ' db self ,
@@ -395,21 +378,6 @@ pub trait HirDatabase: DefDatabase + std::fmt::Debug {
395
378
& ' db self ,
396
379
def : GenericDefId ,
397
380
) -> crate :: lower_nextsolver:: GenericPredicates < ' db > ;
398
-
399
- #[ salsa:: invoke(
400
- crate :: lower_nextsolver:: generic_predicates_without_parent_with_diagnostics_query
401
- ) ]
402
- fn generic_predicates_without_parent_with_diagnostics_ns < ' db > (
403
- & ' db self ,
404
- def : GenericDefId ,
405
- ) -> ( crate :: lower_nextsolver:: GenericPredicates < ' db > , Diagnostics ) ;
406
-
407
- #[ salsa:: invoke( crate :: lower_nextsolver:: generic_predicates_without_parent_query) ]
408
- #[ salsa:: transparent]
409
- fn generic_predicates_without_parent_ns < ' db > (
410
- & ' db self ,
411
- def : GenericDefId ,
412
- ) -> crate :: lower_nextsolver:: GenericPredicates < ' db > ;
413
381
}
414
382
415
383
#[ test]
0 commit comments