@@ -206,179 +206,180 @@ impl<'tcx> chalk_ir::interner::Interner for RustInterner<'tcx> {
206
206
Some ( write ! ( fmt, "{:?}" , opaque_ty. opaque_ty_id) )
207
207
}
208
208
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 } )
211
212
}
212
213
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 > {
214
215
ty
215
216
}
216
217
217
- fn intern_lifetime ( & self , lifetime : chalk_ir:: LifetimeData < Self > ) -> Self :: InternedLifetime {
218
+ fn intern_lifetime ( self , lifetime : chalk_ir:: LifetimeData < Self > ) -> Self :: InternedLifetime {
218
219
Box :: new ( lifetime)
219
220
}
220
221
221
222
fn lifetime_data < ' a > (
222
- & self ,
223
+ self ,
223
224
lifetime : & ' a Self :: InternedLifetime ,
224
225
) -> & ' a chalk_ir:: LifetimeData < Self > {
225
226
& lifetime
226
227
}
227
228
228
- fn intern_const ( & self , constant : chalk_ir:: ConstData < Self > ) -> Self :: InternedConst {
229
+ fn intern_const ( self , constant : chalk_ir:: ConstData < Self > ) -> Self :: InternedConst {
229
230
Box :: new ( constant)
230
231
}
231
232
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 > {
233
234
& constant
234
235
}
235
236
236
237
fn const_eq (
237
- & self ,
238
+ self ,
238
239
_ty : & Self :: InternedType ,
239
240
c1 : & Self :: InternedConcreteConst ,
240
241
c2 : & Self :: InternedConcreteConst ,
241
242
) -> bool {
242
243
c1 == c2
243
244
}
244
245
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 {
246
247
Box :: new ( data)
247
248
}
248
249
249
250
fn generic_arg_data < ' a > (
250
- & self ,
251
+ self ,
251
252
data : & ' a Self :: InternedGenericArg ,
252
253
) -> & ' a chalk_ir:: GenericArgData < Self > {
253
254
& data
254
255
}
255
256
256
- fn intern_goal ( & self , goal : chalk_ir:: GoalData < Self > ) -> Self :: InternedGoal {
257
+ fn intern_goal ( self , goal : chalk_ir:: GoalData < Self > ) -> Self :: InternedGoal {
257
258
Box :: new ( goal)
258
259
}
259
260
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 > {
261
262
& goal
262
263
}
263
264
264
265
fn intern_goals < E > (
265
- & self ,
266
+ self ,
266
267
data : impl IntoIterator < Item = Result < chalk_ir:: Goal < Self > , E > > ,
267
268
) -> Result < Self :: InternedGoals , E > {
268
269
data. into_iter ( ) . collect :: < Result < Vec < _ > , _ > > ( )
269
270
}
270
271
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 > ] {
272
273
goals
273
274
}
274
275
275
276
fn intern_substitution < E > (
276
- & self ,
277
+ self ,
277
278
data : impl IntoIterator < Item = Result < chalk_ir:: GenericArg < Self > , E > > ,
278
279
) -> Result < Self :: InternedSubstitution , E > {
279
280
data. into_iter ( ) . collect :: < Result < Vec < _ > , _ > > ( )
280
281
}
281
282
282
283
fn substitution_data < ' a > (
283
- & self ,
284
+ self ,
284
285
substitution : & ' a Self :: InternedSubstitution ,
285
286
) -> & ' a [ chalk_ir:: GenericArg < Self > ] {
286
287
substitution
287
288
}
288
289
289
290
fn intern_program_clause (
290
- & self ,
291
+ self ,
291
292
data : chalk_ir:: ProgramClauseData < Self > ,
292
293
) -> Self :: InternedProgramClause {
293
294
Box :: new ( data)
294
295
}
295
296
296
297
fn program_clause_data < ' a > (
297
- & self ,
298
+ self ,
298
299
clause : & ' a Self :: InternedProgramClause ,
299
300
) -> & ' a chalk_ir:: ProgramClauseData < Self > {
300
301
& clause
301
302
}
302
303
303
304
fn intern_program_clauses < E > (
304
- & self ,
305
+ self ,
305
306
data : impl IntoIterator < Item = Result < chalk_ir:: ProgramClause < Self > , E > > ,
306
307
) -> Result < Self :: InternedProgramClauses , E > {
307
308
data. into_iter ( ) . collect :: < Result < Vec < _ > , _ > > ( )
308
309
}
309
310
310
311
fn program_clauses_data < ' a > (
311
- & self ,
312
+ self ,
312
313
clauses : & ' a Self :: InternedProgramClauses ,
313
314
) -> & ' a [ chalk_ir:: ProgramClause < Self > ] {
314
315
clauses
315
316
}
316
317
317
318
fn intern_quantified_where_clauses < E > (
318
- & self ,
319
+ self ,
319
320
data : impl IntoIterator < Item = Result < chalk_ir:: QuantifiedWhereClause < Self > , E > > ,
320
321
) -> Result < Self :: InternedQuantifiedWhereClauses , E > {
321
322
data. into_iter ( ) . collect :: < Result < Vec < _ > , _ > > ( )
322
323
}
323
324
324
325
fn quantified_where_clauses_data < ' a > (
325
- & self ,
326
+ self ,
326
327
clauses : & ' a Self :: InternedQuantifiedWhereClauses ,
327
328
) -> & ' a [ chalk_ir:: QuantifiedWhereClause < Self > ] {
328
329
clauses
329
330
}
330
331
331
332
fn intern_generic_arg_kinds < E > (
332
- & self ,
333
+ self ,
333
334
data : impl IntoIterator < Item = Result < chalk_ir:: VariableKind < Self > , E > > ,
334
335
) -> Result < Self :: InternedVariableKinds , E > {
335
336
data. into_iter ( ) . collect :: < Result < Vec < _ > , _ > > ( )
336
337
}
337
338
338
339
fn variable_kinds_data < ' a > (
339
- & self ,
340
+ self ,
340
341
parameter_kinds : & ' a Self :: InternedVariableKinds ,
341
342
) -> & ' a [ chalk_ir:: VariableKind < Self > ] {
342
343
parameter_kinds
343
344
}
344
345
345
346
fn intern_canonical_var_kinds < E > (
346
- & self ,
347
+ self ,
347
348
data : impl IntoIterator < Item = Result < chalk_ir:: CanonicalVarKind < Self > , E > > ,
348
349
) -> Result < Self :: InternedCanonicalVarKinds , E > {
349
350
data. into_iter ( ) . collect :: < Result < Vec < _ > , _ > > ( )
350
351
}
351
352
352
353
fn canonical_var_kinds_data < ' a > (
353
- & self ,
354
+ self ,
354
355
canonical_var_kinds : & ' a Self :: InternedCanonicalVarKinds ,
355
356
) -> & ' a [ chalk_ir:: CanonicalVarKind < Self > ] {
356
357
canonical_var_kinds
357
358
}
358
359
359
360
fn intern_constraints < E > (
360
- & self ,
361
+ self ,
361
362
data : impl IntoIterator < Item = Result < chalk_ir:: InEnvironment < chalk_ir:: Constraint < Self > > , E > > ,
362
363
) -> Result < Self :: InternedConstraints , E > {
363
364
data. into_iter ( ) . collect :: < Result < Vec < _ > , _ > > ( )
364
365
}
365
366
366
367
fn constraints_data < ' a > (
367
- & self ,
368
+ self ,
368
369
constraints : & ' a Self :: InternedConstraints ,
369
370
) -> & ' a [ chalk_ir:: InEnvironment < chalk_ir:: Constraint < Self > > ] {
370
371
constraints
371
372
}
372
373
373
374
fn intern_variances < E > (
374
- & self ,
375
+ self ,
375
376
data : impl IntoIterator < Item = Result < chalk_ir:: Variance , E > > ,
376
377
) -> Result < Self :: InternedVariances , E > {
377
378
data. into_iter ( ) . collect :: < Result < Vec < _ > , _ > > ( )
378
379
}
379
380
380
381
fn variances_data < ' a > (
381
- & self ,
382
+ self ,
382
383
variances : & ' a Self :: InternedVariances ,
383
384
) -> & ' a [ chalk_ir:: Variance ] {
384
385
variances
0 commit comments