@@ -84,7 +84,6 @@ impl<'tcx> InferCtxt<'tcx> {
8484
8585pub trait ToTrace < ' tcx > : Relate < ' tcx > + Copy {
8686 fn to_trace (
87- tcx : TyCtxt < ' tcx > ,
8887 cause : & ObligationCause < ' tcx > ,
8988 a_is_expected : bool ,
9089 a : Self ,
@@ -233,7 +232,7 @@ impl<'a, 'tcx> At<'a, 'tcx> {
233232 where
234233 T : ToTrace < ' tcx > ,
235234 {
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) ;
237236 Trace { at : self , trace, a_is_expected }
238237 }
239238}
@@ -306,18 +305,17 @@ impl<'a, 'tcx> Trace<'a, 'tcx> {
306305
307306impl < ' tcx > ToTrace < ' tcx > for ImplSubject < ' tcx > {
308307 fn to_trace (
309- tcx : TyCtxt < ' tcx > ,
310308 cause : & ObligationCause < ' tcx > ,
311309 a_is_expected : bool ,
312310 a : Self ,
313311 b : Self ,
314312 ) -> TypeTrace < ' tcx > {
315313 match ( a, b) {
316314 ( 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)
318316 }
319317 ( 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)
321319 }
322320 ( ImplSubject :: Trait ( _) , ImplSubject :: Inherent ( _) )
323321 | ( ImplSubject :: Inherent ( _) , ImplSubject :: Trait ( _) ) => {
@@ -329,7 +327,6 @@ impl<'tcx> ToTrace<'tcx> for ImplSubject<'tcx> {
329327
330328impl < ' tcx > ToTrace < ' tcx > for Ty < ' tcx > {
331329 fn to_trace (
332- _: TyCtxt < ' tcx > ,
333330 cause : & ObligationCause < ' tcx > ,
334331 a_is_expected : bool ,
335332 a : Self ,
@@ -344,7 +341,6 @@ impl<'tcx> ToTrace<'tcx> for Ty<'tcx> {
344341
345342impl < ' tcx > ToTrace < ' tcx > for ty:: Region < ' tcx > {
346343 fn to_trace (
347- _: TyCtxt < ' tcx > ,
348344 cause : & ObligationCause < ' tcx > ,
349345 a_is_expected : bool ,
350346 a : Self ,
@@ -356,7 +352,6 @@ impl<'tcx> ToTrace<'tcx> for ty::Region<'tcx> {
356352
357353impl < ' tcx > ToTrace < ' tcx > for Const < ' tcx > {
358354 fn to_trace (
359- _: TyCtxt < ' tcx > ,
360355 cause : & ObligationCause < ' tcx > ,
361356 a_is_expected : bool ,
362357 a : Self ,
@@ -371,7 +366,6 @@ impl<'tcx> ToTrace<'tcx> for Const<'tcx> {
371366
372367impl < ' tcx > ToTrace < ' tcx > for ty:: GenericArg < ' tcx > {
373368 fn to_trace (
374- _: TyCtxt < ' tcx > ,
375369 cause : & ObligationCause < ' tcx > ,
376370 a_is_expected : bool ,
377371 a : Self ,
@@ -399,7 +393,6 @@ impl<'tcx> ToTrace<'tcx> for ty::GenericArg<'tcx> {
399393
400394impl < ' tcx > ToTrace < ' tcx > for ty:: Term < ' tcx > {
401395 fn to_trace (
402- _: TyCtxt < ' tcx > ,
403396 cause : & ObligationCause < ' tcx > ,
404397 a_is_expected : bool ,
405398 a : Self ,
@@ -411,7 +404,6 @@ impl<'tcx> ToTrace<'tcx> for ty::Term<'tcx> {
411404
412405impl < ' tcx > ToTrace < ' tcx > for ty:: TraitRef < ' tcx > {
413406 fn to_trace (
414- _: TyCtxt < ' tcx > ,
415407 cause : & ObligationCause < ' tcx > ,
416408 a_is_expected : bool ,
417409 a : Self ,
@@ -426,7 +418,6 @@ impl<'tcx> ToTrace<'tcx> for ty::TraitRef<'tcx> {
426418
427419impl < ' tcx > ToTrace < ' tcx > for ty:: PolyTraitRef < ' tcx > {
428420 fn to_trace (
429- _: TyCtxt < ' tcx > ,
430421 cause : & ObligationCause < ' tcx > ,
431422 a_is_expected : bool ,
432423 a : Self ,
@@ -441,24 +432,17 @@ impl<'tcx> ToTrace<'tcx> for ty::PolyTraitRef<'tcx> {
441432
442433impl < ' tcx > ToTrace < ' tcx > for ty:: AliasTy < ' tcx > {
443434 fn to_trace (
444- tcx : TyCtxt < ' tcx > ,
445435 cause : & ObligationCause < ' tcx > ,
446436 a_is_expected : bool ,
447437 a : Self ,
448438 b : Self ,
449439 ) -> 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) ) }
456441 }
457442}
458443
459444impl < ' tcx > ToTrace < ' tcx > for ty:: FnSig < ' tcx > {
460445 fn to_trace (
461- _: TyCtxt < ' tcx > ,
462446 cause : & ObligationCause < ' tcx > ,
463447 a_is_expected : bool ,
464448 a : Self ,
0 commit comments