@@ -84,7 +84,6 @@ impl<'tcx> InferCtxt<'tcx> {
84
84
85
85
pub trait ToTrace < ' tcx > : Relate < ' tcx > + Copy {
86
86
fn to_trace (
87
- tcx : TyCtxt < ' tcx > ,
88
87
cause : & ObligationCause < ' tcx > ,
89
88
a_is_expected : bool ,
90
89
a : Self ,
@@ -233,7 +232,7 @@ impl<'a, 'tcx> At<'a, 'tcx> {
233
232
where
234
233
T : ToTrace < ' tcx > ,
235
234
{
236
- let trace = ToTrace :: to_trace ( self . infcx . tcx , self . cause , a_is_expected, a, b) ;
235
+ let trace = ToTrace :: to_trace ( self . cause , a_is_expected, a, b) ;
237
236
Trace { at : self , trace, a_is_expected }
238
237
}
239
238
}
@@ -306,18 +305,17 @@ impl<'a, 'tcx> Trace<'a, 'tcx> {
306
305
307
306
impl < ' tcx > ToTrace < ' tcx > for ImplSubject < ' tcx > {
308
307
fn to_trace (
309
- tcx : TyCtxt < ' tcx > ,
310
308
cause : & ObligationCause < ' tcx > ,
311
309
a_is_expected : bool ,
312
310
a : Self ,
313
311
b : Self ,
314
312
) -> TypeTrace < ' tcx > {
315
313
match ( a, b) {
316
314
( ImplSubject :: Trait ( trait_ref_a) , ImplSubject :: Trait ( trait_ref_b) ) => {
317
- ToTrace :: to_trace ( tcx , cause, a_is_expected, trait_ref_a, trait_ref_b)
315
+ ToTrace :: to_trace ( cause, a_is_expected, trait_ref_a, trait_ref_b)
318
316
}
319
317
( ImplSubject :: Inherent ( ty_a) , ImplSubject :: Inherent ( ty_b) ) => {
320
- ToTrace :: to_trace ( tcx , cause, a_is_expected, ty_a, ty_b)
318
+ ToTrace :: to_trace ( cause, a_is_expected, ty_a, ty_b)
321
319
}
322
320
( ImplSubject :: Trait ( _) , ImplSubject :: Inherent ( _) )
323
321
| ( ImplSubject :: Inherent ( _) , ImplSubject :: Trait ( _) ) => {
@@ -329,7 +327,6 @@ impl<'tcx> ToTrace<'tcx> for ImplSubject<'tcx> {
329
327
330
328
impl < ' tcx > ToTrace < ' tcx > for Ty < ' tcx > {
331
329
fn to_trace (
332
- _: TyCtxt < ' tcx > ,
333
330
cause : & ObligationCause < ' tcx > ,
334
331
a_is_expected : bool ,
335
332
a : Self ,
@@ -344,7 +341,6 @@ impl<'tcx> ToTrace<'tcx> for Ty<'tcx> {
344
341
345
342
impl < ' tcx > ToTrace < ' tcx > for ty:: Region < ' tcx > {
346
343
fn to_trace (
347
- _: TyCtxt < ' tcx > ,
348
344
cause : & ObligationCause < ' tcx > ,
349
345
a_is_expected : bool ,
350
346
a : Self ,
@@ -356,7 +352,6 @@ impl<'tcx> ToTrace<'tcx> for ty::Region<'tcx> {
356
352
357
353
impl < ' tcx > ToTrace < ' tcx > for Const < ' tcx > {
358
354
fn to_trace (
359
- _: TyCtxt < ' tcx > ,
360
355
cause : & ObligationCause < ' tcx > ,
361
356
a_is_expected : bool ,
362
357
a : Self ,
@@ -371,7 +366,6 @@ impl<'tcx> ToTrace<'tcx> for Const<'tcx> {
371
366
372
367
impl < ' tcx > ToTrace < ' tcx > for ty:: GenericArg < ' tcx > {
373
368
fn to_trace (
374
- _: TyCtxt < ' tcx > ,
375
369
cause : & ObligationCause < ' tcx > ,
376
370
a_is_expected : bool ,
377
371
a : Self ,
@@ -399,7 +393,6 @@ impl<'tcx> ToTrace<'tcx> for ty::GenericArg<'tcx> {
399
393
400
394
impl < ' tcx > ToTrace < ' tcx > for ty:: Term < ' tcx > {
401
395
fn to_trace (
402
- _: TyCtxt < ' tcx > ,
403
396
cause : & ObligationCause < ' tcx > ,
404
397
a_is_expected : bool ,
405
398
a : Self ,
@@ -411,7 +404,6 @@ impl<'tcx> ToTrace<'tcx> for ty::Term<'tcx> {
411
404
412
405
impl < ' tcx > ToTrace < ' tcx > for ty:: TraitRef < ' tcx > {
413
406
fn to_trace (
414
- _: TyCtxt < ' tcx > ,
415
407
cause : & ObligationCause < ' tcx > ,
416
408
a_is_expected : bool ,
417
409
a : Self ,
@@ -426,7 +418,6 @@ impl<'tcx> ToTrace<'tcx> for ty::TraitRef<'tcx> {
426
418
427
419
impl < ' tcx > ToTrace < ' tcx > for ty:: PolyTraitRef < ' tcx > {
428
420
fn to_trace (
429
- _: TyCtxt < ' tcx > ,
430
421
cause : & ObligationCause < ' tcx > ,
431
422
a_is_expected : bool ,
432
423
a : Self ,
@@ -441,24 +432,17 @@ impl<'tcx> ToTrace<'tcx> for ty::PolyTraitRef<'tcx> {
441
432
442
433
impl < ' tcx > ToTrace < ' tcx > for ty:: AliasTy < ' tcx > {
443
434
fn to_trace (
444
- tcx : TyCtxt < ' tcx > ,
445
435
cause : & ObligationCause < ' tcx > ,
446
436
a_is_expected : bool ,
447
437
a : Self ,
448
438
b : Self ,
449
439
) -> TypeTrace < ' tcx > {
450
- let a_ty = tcx. mk_projection ( a. def_id , a. substs ) ;
451
- let b_ty = tcx. mk_projection ( b. def_id , b. substs ) ;
452
- TypeTrace {
453
- cause : cause. clone ( ) ,
454
- values : Terms ( ExpectedFound :: new ( a_is_expected, a_ty. into ( ) , b_ty. into ( ) ) ) ,
455
- }
440
+ TypeTrace { cause : cause. clone ( ) , values : Aliases ( ExpectedFound :: new ( a_is_expected, a, b) ) }
456
441
}
457
442
}
458
443
459
444
impl < ' tcx > ToTrace < ' tcx > for ty:: FnSig < ' tcx > {
460
445
fn to_trace (
461
- _: TyCtxt < ' tcx > ,
462
446
cause : & ObligationCause < ' tcx > ,
463
447
a_is_expected : bool ,
464
448
a : Self ,
0 commit comments