@@ -16,8 +16,8 @@ use smallvec::SmallVec;
1616use triomphe:: Arc ;
1717
1818use 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,
2121 consteval:: ConstEvalError ,
2222 drop:: DropGlue ,
2323 dyn_compatibility:: DynCompatibilityViolation ,
@@ -114,55 +114,88 @@ pub trait HirDatabase: DefDatabase + std::fmt::Debug {
114114 #[ salsa:: invoke( crate :: dyn_compatibility:: dyn_compatibility_of_trait_query) ]
115115 fn dyn_compatibility_of_trait ( & self , trait_ : TraitId ) -> Option < DynCompatibilityViolation > ;
116116
117- #[ salsa:: invoke( crate :: lower :: ty_query) ]
117+ #[ salsa:: invoke( crate :: lower_nextsolver :: ty_query) ]
118118 #[ 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 > > ;
120123
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 ) ;
124130
125131 /// Returns the type of the value of the given constant, or `None` if the `ValueTyDefId` is
126132 /// 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 > > > ;
129138
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 ) ;
133145
134146 #[ salsa:: invoke( crate :: lower:: impl_self_ty_query) ]
135147 #[ salsa:: transparent]
136148 fn impl_self_ty ( & self , def : ImplId ) -> Binders < Ty > ;
137149
138150 // 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 ) ;
142157
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) ]
145161 fn const_param_ty ( & self , def : ConstParamId ) -> Ty ;
146162
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+ ) > ;
149171
150172 #[ salsa:: invoke( crate :: lower:: impl_trait_query) ]
151173 #[ salsa:: transparent]
152174 fn impl_trait ( & self , def : ImplId ) -> Option < Binders < TraitRef > > ;
153175
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 ,
157179 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+ ) ;
159189
160190 #[ salsa:: invoke( crate :: lower:: field_types_query) ]
161191 #[ salsa:: transparent]
162192 fn field_types ( & self , var : VariantId ) -> Arc < ArenaMap < LocalFieldId , Binders < Ty > > > ;
163193
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 > > ;
166199
167200 #[ salsa:: invoke( crate :: lower:: return_type_impl_traits) ]
168201 fn return_type_impl_traits ( & self , def : FunctionId ) -> Option < Arc < Binders < ImplTraits > > > ;
@@ -182,6 +215,21 @@ pub trait HirDatabase: DefDatabase + std::fmt::Debug {
182215 #[ salsa:: invoke( crate :: lower:: generic_predicates_query) ]
183216 fn generic_predicates ( & self , def : GenericDefId ) -> GenericPredicates ;
184217
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+
185233 #[ salsa:: invoke( crate :: lower_nextsolver:: trait_environment_for_body_query) ]
186234 #[ salsa:: transparent]
187235 fn trait_environment_for_body < ' db > ( & ' db self , def : DefWithBodyId )
@@ -277,83 +325,24 @@ pub trait HirDatabase: DefDatabase + std::fmt::Debug {
277325
278326 // next trait solver
279327
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-
309328 #[ salsa:: invoke( crate :: lower_nextsolver:: impl_self_ty_query) ]
310329 #[ salsa:: transparent]
311330 fn impl_self_ty_ns < ' db > (
312331 & ' db self ,
313332 def : ImplId ,
314333 ) -> crate :: next_solver:: EarlyBinder < ' db , crate :: next_solver:: Ty < ' db > > ;
315334
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-
323335 #[ salsa:: invoke( crate :: lower_nextsolver:: const_param_ty_query) ]
324336 #[ salsa:: transparent]
325337 fn const_param_ty_ns < ' db > ( & ' db self , def : ConstParamId ) -> crate :: next_solver:: Ty < ' db > ;
326338
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-
336339 #[ salsa:: invoke( crate :: lower_nextsolver:: impl_trait_query) ]
337340 #[ salsa:: transparent]
338341 fn impl_trait_ns < ' db > (
339342 & ' db self ,
340343 def : ImplId ,
341344 ) -> Option < crate :: next_solver:: EarlyBinder < ' db , crate :: next_solver:: TraitRef < ' db > > > ;
342345
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-
357346 #[ salsa:: invoke( crate :: lower_nextsolver:: field_types_query) ]
358347 #[ salsa:: transparent]
359348 fn field_types_ns < ' db > (
@@ -363,12 +352,6 @@ pub trait HirDatabase: DefDatabase + std::fmt::Debug {
363352 ArenaMap < LocalFieldId , crate :: next_solver:: EarlyBinder < ' db , crate :: next_solver:: Ty < ' db > > > ,
364353 > ;
365354
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-
372355 #[ salsa:: invoke( crate :: lower_nextsolver:: return_type_impl_traits) ]
373356 fn return_type_impl_traits_ns < ' db > (
374357 & ' db self ,
@@ -395,21 +378,6 @@ pub trait HirDatabase: DefDatabase + std::fmt::Debug {
395378 & ' db self ,
396379 def : GenericDefId ,
397380 ) -> 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 > ;
413381}
414382
415383#[ test]
0 commit comments