@@ -206,179 +206,180 @@ impl<'tcx> chalk_ir::interner::Interner for RustInterner<'tcx> {
206206 Some ( write ! ( fmt, "{:?}" , opaque_ty. opaque_ty_id) )
207207 }
208208
209- fn intern_ty ( & self , ty : chalk_ir:: TyData < Self > ) -> Self :: InternedType {
210- Box :: new ( ty)
209+ fn intern_ty ( self , ty : chalk_ir:: TyKind < Self > ) -> Self :: InternedType {
210+ let flags = ty. compute_flags ( self ) ;
211+ Box :: new ( chalk_ir:: TyData { kind : ty, flags : flags } )
211212 }
212213
213- fn ty_data < ' a > ( & self , ty : & ' a Self :: InternedType ) -> & ' a chalk_ir:: TyData < Self > {
214+ fn ty_data < ' a > ( self , ty : & ' a Self :: InternedType ) -> & ' a chalk_ir:: TyData < Self > {
214215 ty
215216 }
216217
217- fn intern_lifetime ( & self , lifetime : chalk_ir:: LifetimeData < Self > ) -> Self :: InternedLifetime {
218+ fn intern_lifetime ( self , lifetime : chalk_ir:: LifetimeData < Self > ) -> Self :: InternedLifetime {
218219 Box :: new ( lifetime)
219220 }
220221
221222 fn lifetime_data < ' a > (
222- & self ,
223+ self ,
223224 lifetime : & ' a Self :: InternedLifetime ,
224225 ) -> & ' a chalk_ir:: LifetimeData < Self > {
225226 & lifetime
226227 }
227228
228- fn intern_const ( & self , constant : chalk_ir:: ConstData < Self > ) -> Self :: InternedConst {
229+ fn intern_const ( self , constant : chalk_ir:: ConstData < Self > ) -> Self :: InternedConst {
229230 Box :: new ( constant)
230231 }
231232
232- fn const_data < ' a > ( & self , constant : & ' a Self :: InternedConst ) -> & ' a chalk_ir:: ConstData < Self > {
233+ fn const_data < ' a > ( self , constant : & ' a Self :: InternedConst ) -> & ' a chalk_ir:: ConstData < Self > {
233234 & constant
234235 }
235236
236237 fn const_eq (
237- & self ,
238+ self ,
238239 _ty : & Self :: InternedType ,
239240 c1 : & Self :: InternedConcreteConst ,
240241 c2 : & Self :: InternedConcreteConst ,
241242 ) -> bool {
242243 c1 == c2
243244 }
244245
245- fn intern_generic_arg ( & self , data : chalk_ir:: GenericArgData < Self > ) -> Self :: InternedGenericArg {
246+ fn intern_generic_arg ( self , data : chalk_ir:: GenericArgData < Self > ) -> Self :: InternedGenericArg {
246247 Box :: new ( data)
247248 }
248249
249250 fn generic_arg_data < ' a > (
250- & self ,
251+ self ,
251252 data : & ' a Self :: InternedGenericArg ,
252253 ) -> & ' a chalk_ir:: GenericArgData < Self > {
253254 & data
254255 }
255256
256- fn intern_goal ( & self , goal : chalk_ir:: GoalData < Self > ) -> Self :: InternedGoal {
257+ fn intern_goal ( self , goal : chalk_ir:: GoalData < Self > ) -> Self :: InternedGoal {
257258 Box :: new ( goal)
258259 }
259260
260- fn goal_data < ' a > ( & self , goal : & ' a Self :: InternedGoal ) -> & ' a chalk_ir:: GoalData < Self > {
261+ fn goal_data < ' a > ( self , goal : & ' a Self :: InternedGoal ) -> & ' a chalk_ir:: GoalData < Self > {
261262 & goal
262263 }
263264
264265 fn intern_goals < E > (
265- & self ,
266+ self ,
266267 data : impl IntoIterator < Item = Result < chalk_ir:: Goal < Self > , E > > ,
267268 ) -> Result < Self :: InternedGoals , E > {
268269 data. into_iter ( ) . collect :: < Result < Vec < _ > , _ > > ( )
269270 }
270271
271- fn goals_data < ' a > ( & self , goals : & ' a Self :: InternedGoals ) -> & ' a [ chalk_ir:: Goal < Self > ] {
272+ fn goals_data < ' a > ( self , goals : & ' a Self :: InternedGoals ) -> & ' a [ chalk_ir:: Goal < Self > ] {
272273 goals
273274 }
274275
275276 fn intern_substitution < E > (
276- & self ,
277+ self ,
277278 data : impl IntoIterator < Item = Result < chalk_ir:: GenericArg < Self > , E > > ,
278279 ) -> Result < Self :: InternedSubstitution , E > {
279280 data. into_iter ( ) . collect :: < Result < Vec < _ > , _ > > ( )
280281 }
281282
282283 fn substitution_data < ' a > (
283- & self ,
284+ self ,
284285 substitution : & ' a Self :: InternedSubstitution ,
285286 ) -> & ' a [ chalk_ir:: GenericArg < Self > ] {
286287 substitution
287288 }
288289
289290 fn intern_program_clause (
290- & self ,
291+ self ,
291292 data : chalk_ir:: ProgramClauseData < Self > ,
292293 ) -> Self :: InternedProgramClause {
293294 Box :: new ( data)
294295 }
295296
296297 fn program_clause_data < ' a > (
297- & self ,
298+ self ,
298299 clause : & ' a Self :: InternedProgramClause ,
299300 ) -> & ' a chalk_ir:: ProgramClauseData < Self > {
300301 & clause
301302 }
302303
303304 fn intern_program_clauses < E > (
304- & self ,
305+ self ,
305306 data : impl IntoIterator < Item = Result < chalk_ir:: ProgramClause < Self > , E > > ,
306307 ) -> Result < Self :: InternedProgramClauses , E > {
307308 data. into_iter ( ) . collect :: < Result < Vec < _ > , _ > > ( )
308309 }
309310
310311 fn program_clauses_data < ' a > (
311- & self ,
312+ self ,
312313 clauses : & ' a Self :: InternedProgramClauses ,
313314 ) -> & ' a [ chalk_ir:: ProgramClause < Self > ] {
314315 clauses
315316 }
316317
317318 fn intern_quantified_where_clauses < E > (
318- & self ,
319+ self ,
319320 data : impl IntoIterator < Item = Result < chalk_ir:: QuantifiedWhereClause < Self > , E > > ,
320321 ) -> Result < Self :: InternedQuantifiedWhereClauses , E > {
321322 data. into_iter ( ) . collect :: < Result < Vec < _ > , _ > > ( )
322323 }
323324
324325 fn quantified_where_clauses_data < ' a > (
325- & self ,
326+ self ,
326327 clauses : & ' a Self :: InternedQuantifiedWhereClauses ,
327328 ) -> & ' a [ chalk_ir:: QuantifiedWhereClause < Self > ] {
328329 clauses
329330 }
330331
331332 fn intern_generic_arg_kinds < E > (
332- & self ,
333+ self ,
333334 data : impl IntoIterator < Item = Result < chalk_ir:: VariableKind < Self > , E > > ,
334335 ) -> Result < Self :: InternedVariableKinds , E > {
335336 data. into_iter ( ) . collect :: < Result < Vec < _ > , _ > > ( )
336337 }
337338
338339 fn variable_kinds_data < ' a > (
339- & self ,
340+ self ,
340341 parameter_kinds : & ' a Self :: InternedVariableKinds ,
341342 ) -> & ' a [ chalk_ir:: VariableKind < Self > ] {
342343 parameter_kinds
343344 }
344345
345346 fn intern_canonical_var_kinds < E > (
346- & self ,
347+ self ,
347348 data : impl IntoIterator < Item = Result < chalk_ir:: CanonicalVarKind < Self > , E > > ,
348349 ) -> Result < Self :: InternedCanonicalVarKinds , E > {
349350 data. into_iter ( ) . collect :: < Result < Vec < _ > , _ > > ( )
350351 }
351352
352353 fn canonical_var_kinds_data < ' a > (
353- & self ,
354+ self ,
354355 canonical_var_kinds : & ' a Self :: InternedCanonicalVarKinds ,
355356 ) -> & ' a [ chalk_ir:: CanonicalVarKind < Self > ] {
356357 canonical_var_kinds
357358 }
358359
359360 fn intern_constraints < E > (
360- & self ,
361+ self ,
361362 data : impl IntoIterator < Item = Result < chalk_ir:: InEnvironment < chalk_ir:: Constraint < Self > > , E > > ,
362363 ) -> Result < Self :: InternedConstraints , E > {
363364 data. into_iter ( ) . collect :: < Result < Vec < _ > , _ > > ( )
364365 }
365366
366367 fn constraints_data < ' a > (
367- & self ,
368+ self ,
368369 constraints : & ' a Self :: InternedConstraints ,
369370 ) -> & ' a [ chalk_ir:: InEnvironment < chalk_ir:: Constraint < Self > > ] {
370371 constraints
371372 }
372373
373374 fn intern_variances < E > (
374- & self ,
375+ self ,
375376 data : impl IntoIterator < Item = Result < chalk_ir:: Variance , E > > ,
376377 ) -> Result < Self :: InternedVariances , E > {
377378 data. into_iter ( ) . collect :: < Result < Vec < _ > , _ > > ( )
378379 }
379380
380381 fn variances_data < ' a > (
381- & self ,
382+ self ,
382383 variances : & ' a Self :: InternedVariances ,
383384 ) -> & ' a [ chalk_ir:: Variance ] {
384385 variances
0 commit comments