@@ -92,12 +92,7 @@ impl<'tcx> InferCtxt<'tcx> {
9292}
9393
9494pub trait ToTrace < ' tcx > : Relate < TyCtxt < ' tcx > > + Copy {
95- fn to_trace (
96- cause : & ObligationCause < ' tcx > ,
97- a_is_expected : bool ,
98- a : Self ,
99- b : Self ,
100- ) -> TypeTrace < ' tcx > ;
95+ fn to_trace ( cause : & ObligationCause < ' tcx > , a : Self , b : Self ) -> TypeTrace < ' tcx > ;
10196}
10297
10398impl < ' a , ' tcx > At < ' a , ' tcx > {
@@ -116,7 +111,7 @@ impl<'a, 'tcx> At<'a, 'tcx> {
116111 {
117112 let mut fields = CombineFields :: new (
118113 self . infcx ,
119- ToTrace :: to_trace ( self . cause , true , expected, actual) ,
114+ ToTrace :: to_trace ( self . cause , expected, actual) ,
120115 self . param_env ,
121116 define_opaque_types,
122117 ) ;
@@ -136,7 +131,7 @@ impl<'a, 'tcx> At<'a, 'tcx> {
136131 {
137132 let mut fields = CombineFields :: new (
138133 self . infcx ,
139- ToTrace :: to_trace ( self . cause , true , expected, actual) ,
134+ ToTrace :: to_trace ( self . cause , expected, actual) ,
140135 self . param_env ,
141136 define_opaque_types,
142137 ) ;
@@ -156,7 +151,7 @@ impl<'a, 'tcx> At<'a, 'tcx> {
156151 {
157152 let mut fields = CombineFields :: new (
158153 self . infcx ,
159- ToTrace :: to_trace ( self . cause , true , expected, actual) ,
154+ ToTrace :: to_trace ( self . cause , expected, actual) ,
160155 self . param_env ,
161156 define_opaque_types,
162157 ) ;
@@ -222,7 +217,7 @@ impl<'a, 'tcx> At<'a, 'tcx> {
222217 assert ! ( self . infcx. next_trait_solver( ) ) ;
223218 let mut fields = CombineFields :: new (
224219 self . infcx ,
225- ToTrace :: to_trace ( self . cause , true , expected, actual) ,
220+ ToTrace :: to_trace ( self . cause , expected, actual) ,
226221 self . param_env ,
227222 DefineOpaqueTypes :: Yes ,
228223 ) ;
@@ -314,7 +309,7 @@ impl<'a, 'tcx> At<'a, 'tcx> {
314309 {
315310 let mut fields = CombineFields :: new (
316311 self . infcx ,
317- ToTrace :: to_trace ( self . cause , true , expected, actual) ,
312+ ToTrace :: to_trace ( self . cause , expected, actual) ,
318313 self . param_env ,
319314 define_opaque_types,
320315 ) ;
@@ -336,7 +331,7 @@ impl<'a, 'tcx> At<'a, 'tcx> {
336331 {
337332 let mut fields = CombineFields :: new (
338333 self . infcx ,
339- ToTrace :: to_trace ( self . cause , true , expected, actual) ,
334+ ToTrace :: to_trace ( self . cause , expected, actual) ,
340335 self . param_env ,
341336 define_opaque_types,
342337 ) ;
@@ -346,18 +341,13 @@ impl<'a, 'tcx> At<'a, 'tcx> {
346341}
347342
348343impl < ' tcx > ToTrace < ' tcx > for ImplSubject < ' tcx > {
349- fn to_trace (
350- cause : & ObligationCause < ' tcx > ,
351- a_is_expected : bool ,
352- a : Self ,
353- b : Self ,
354- ) -> TypeTrace < ' tcx > {
344+ fn to_trace ( cause : & ObligationCause < ' tcx > , a : Self , b : Self ) -> TypeTrace < ' tcx > {
355345 match ( a, b) {
356346 ( ImplSubject :: Trait ( trait_ref_a) , ImplSubject :: Trait ( trait_ref_b) ) => {
357- ToTrace :: to_trace ( cause, a_is_expected , trait_ref_a, trait_ref_b)
347+ ToTrace :: to_trace ( cause, trait_ref_a, trait_ref_b)
358348 }
359349 ( ImplSubject :: Inherent ( ty_a) , ImplSubject :: Inherent ( ty_b) ) => {
360- ToTrace :: to_trace ( cause, a_is_expected , ty_a, ty_b)
350+ ToTrace :: to_trace ( cause, ty_a, ty_b)
361351 }
362352 ( ImplSubject :: Trait ( _) , ImplSubject :: Inherent ( _) )
363353 | ( ImplSubject :: Inherent ( _) , ImplSubject :: Trait ( _) ) => {
@@ -368,65 +358,45 @@ impl<'tcx> ToTrace<'tcx> for ImplSubject<'tcx> {
368358}
369359
370360impl < ' tcx > ToTrace < ' tcx > for Ty < ' tcx > {
371- fn to_trace (
372- cause : & ObligationCause < ' tcx > ,
373- a_is_expected : bool ,
374- a : Self ,
375- b : Self ,
376- ) -> TypeTrace < ' tcx > {
361+ fn to_trace ( cause : & ObligationCause < ' tcx > , a : Self , b : Self ) -> TypeTrace < ' tcx > {
377362 TypeTrace {
378363 cause : cause. clone ( ) ,
379- values : ValuePairs :: Terms ( ExpectedFound :: new ( a_is_expected , a. into ( ) , b. into ( ) ) ) ,
364+ values : ValuePairs :: Terms ( ExpectedFound :: new ( true , a. into ( ) , b. into ( ) ) ) ,
380365 }
381366 }
382367}
383368
384369impl < ' tcx > ToTrace < ' tcx > for ty:: Region < ' tcx > {
385- fn to_trace (
386- cause : & ObligationCause < ' tcx > ,
387- a_is_expected : bool ,
388- a : Self ,
389- b : Self ,
390- ) -> TypeTrace < ' tcx > {
370+ fn to_trace ( cause : & ObligationCause < ' tcx > , a : Self , b : Self ) -> TypeTrace < ' tcx > {
391371 TypeTrace {
392372 cause : cause. clone ( ) ,
393- values : ValuePairs :: Regions ( ExpectedFound :: new ( a_is_expected , a, b) ) ,
373+ values : ValuePairs :: Regions ( ExpectedFound :: new ( true , a, b) ) ,
394374 }
395375 }
396376}
397377
398378impl < ' tcx > ToTrace < ' tcx > for Const < ' tcx > {
399- fn to_trace (
400- cause : & ObligationCause < ' tcx > ,
401- a_is_expected : bool ,
402- a : Self ,
403- b : Self ,
404- ) -> TypeTrace < ' tcx > {
379+ fn to_trace ( cause : & ObligationCause < ' tcx > , a : Self , b : Self ) -> TypeTrace < ' tcx > {
405380 TypeTrace {
406381 cause : cause. clone ( ) ,
407- values : ValuePairs :: Terms ( ExpectedFound :: new ( a_is_expected , a. into ( ) , b. into ( ) ) ) ,
382+ values : ValuePairs :: Terms ( ExpectedFound :: new ( true , a. into ( ) , b. into ( ) ) ) ,
408383 }
409384 }
410385}
411386
412387impl < ' tcx > ToTrace < ' tcx > for ty:: GenericArg < ' tcx > {
413- fn to_trace (
414- cause : & ObligationCause < ' tcx > ,
415- a_is_expected : bool ,
416- a : Self ,
417- b : Self ,
418- ) -> TypeTrace < ' tcx > {
388+ fn to_trace ( cause : & ObligationCause < ' tcx > , a : Self , b : Self ) -> TypeTrace < ' tcx > {
419389 TypeTrace {
420390 cause : cause. clone ( ) ,
421391 values : match ( a. unpack ( ) , b. unpack ( ) ) {
422392 ( GenericArgKind :: Lifetime ( a) , GenericArgKind :: Lifetime ( b) ) => {
423- ValuePairs :: Regions ( ExpectedFound :: new ( a_is_expected , a, b) )
393+ ValuePairs :: Regions ( ExpectedFound :: new ( true , a, b) )
424394 }
425395 ( GenericArgKind :: Type ( a) , GenericArgKind :: Type ( b) ) => {
426- ValuePairs :: Terms ( ExpectedFound :: new ( a_is_expected , a. into ( ) , b. into ( ) ) )
396+ ValuePairs :: Terms ( ExpectedFound :: new ( true , a. into ( ) , b. into ( ) ) )
427397 }
428398 ( GenericArgKind :: Const ( a) , GenericArgKind :: Const ( b) ) => {
429- ValuePairs :: Terms ( ExpectedFound :: new ( a_is_expected , a. into ( ) , b. into ( ) ) )
399+ ValuePairs :: Terms ( ExpectedFound :: new ( true , a. into ( ) , b. into ( ) ) )
430400 }
431401
432402 (
@@ -449,72 +419,47 @@ impl<'tcx> ToTrace<'tcx> for ty::GenericArg<'tcx> {
449419}
450420
451421impl < ' tcx > ToTrace < ' tcx > for ty:: Term < ' tcx > {
452- fn to_trace (
453- cause : & ObligationCause < ' tcx > ,
454- a_is_expected : bool ,
455- a : Self ,
456- b : Self ,
457- ) -> TypeTrace < ' tcx > {
422+ fn to_trace ( cause : & ObligationCause < ' tcx > , a : Self , b : Self ) -> TypeTrace < ' tcx > {
458423 TypeTrace {
459424 cause : cause. clone ( ) ,
460- values : ValuePairs :: Terms ( ExpectedFound :: new ( a_is_expected , a, b) ) ,
425+ values : ValuePairs :: Terms ( ExpectedFound :: new ( true , a, b) ) ,
461426 }
462427 }
463428}
464429
465430impl < ' tcx > ToTrace < ' tcx > for ty:: TraitRef < ' tcx > {
466- fn to_trace (
467- cause : & ObligationCause < ' tcx > ,
468- a_is_expected : bool ,
469- a : Self ,
470- b : Self ,
471- ) -> TypeTrace < ' tcx > {
431+ fn to_trace ( cause : & ObligationCause < ' tcx > , a : Self , b : Self ) -> TypeTrace < ' tcx > {
472432 TypeTrace {
473433 cause : cause. clone ( ) ,
474- values : ValuePairs :: TraitRefs ( ExpectedFound :: new ( a_is_expected , a, b) ) ,
434+ values : ValuePairs :: TraitRefs ( ExpectedFound :: new ( true , a, b) ) ,
475435 }
476436 }
477437}
478438
479439impl < ' tcx > ToTrace < ' tcx > for ty:: AliasTy < ' tcx > {
480- fn to_trace (
481- cause : & ObligationCause < ' tcx > ,
482- a_is_expected : bool ,
483- a : Self ,
484- b : Self ,
485- ) -> TypeTrace < ' tcx > {
440+ fn to_trace ( cause : & ObligationCause < ' tcx > , a : Self , b : Self ) -> TypeTrace < ' tcx > {
486441 TypeTrace {
487442 cause : cause. clone ( ) ,
488- values : ValuePairs :: Aliases ( ExpectedFound :: new ( a_is_expected , a. into ( ) , b. into ( ) ) ) ,
443+ values : ValuePairs :: Aliases ( ExpectedFound :: new ( true , a. into ( ) , b. into ( ) ) ) ,
489444 }
490445 }
491446}
492447
493448impl < ' tcx > ToTrace < ' tcx > for ty:: AliasTerm < ' tcx > {
494- fn to_trace (
495- cause : & ObligationCause < ' tcx > ,
496- a_is_expected : bool ,
497- a : Self ,
498- b : Self ,
499- ) -> TypeTrace < ' tcx > {
449+ fn to_trace ( cause : & ObligationCause < ' tcx > , a : Self , b : Self ) -> TypeTrace < ' tcx > {
500450 TypeTrace {
501451 cause : cause. clone ( ) ,
502- values : ValuePairs :: Aliases ( ExpectedFound :: new ( a_is_expected , a, b) ) ,
452+ values : ValuePairs :: Aliases ( ExpectedFound :: new ( true , a, b) ) ,
503453 }
504454 }
505455}
506456
507457impl < ' tcx > ToTrace < ' tcx > for ty:: FnSig < ' tcx > {
508- fn to_trace (
509- cause : & ObligationCause < ' tcx > ,
510- a_is_expected : bool ,
511- a : Self ,
512- b : Self ,
513- ) -> TypeTrace < ' tcx > {
458+ fn to_trace ( cause : & ObligationCause < ' tcx > , a : Self , b : Self ) -> TypeTrace < ' tcx > {
514459 TypeTrace {
515460 cause : cause. clone ( ) ,
516461 values : ValuePairs :: PolySigs ( ExpectedFound :: new (
517- a_is_expected ,
462+ true ,
518463 ty:: Binder :: dummy ( a) ,
519464 ty:: Binder :: dummy ( b) ,
520465 ) ) ,
@@ -523,43 +468,28 @@ impl<'tcx> ToTrace<'tcx> for ty::FnSig<'tcx> {
523468}
524469
525470impl < ' tcx > ToTrace < ' tcx > for ty:: PolyFnSig < ' tcx > {
526- fn to_trace (
527- cause : & ObligationCause < ' tcx > ,
528- a_is_expected : bool ,
529- a : Self ,
530- b : Self ,
531- ) -> TypeTrace < ' tcx > {
471+ fn to_trace ( cause : & ObligationCause < ' tcx > , a : Self , b : Self ) -> TypeTrace < ' tcx > {
532472 TypeTrace {
533473 cause : cause. clone ( ) ,
534- values : ValuePairs :: PolySigs ( ExpectedFound :: new ( a_is_expected , a, b) ) ,
474+ values : ValuePairs :: PolySigs ( ExpectedFound :: new ( true , a, b) ) ,
535475 }
536476 }
537477}
538478
539479impl < ' tcx > ToTrace < ' tcx > for ty:: PolyExistentialTraitRef < ' tcx > {
540- fn to_trace (
541- cause : & ObligationCause < ' tcx > ,
542- a_is_expected : bool ,
543- a : Self ,
544- b : Self ,
545- ) -> TypeTrace < ' tcx > {
480+ fn to_trace ( cause : & ObligationCause < ' tcx > , a : Self , b : Self ) -> TypeTrace < ' tcx > {
546481 TypeTrace {
547482 cause : cause. clone ( ) ,
548- values : ValuePairs :: ExistentialTraitRef ( ExpectedFound :: new ( a_is_expected , a, b) ) ,
483+ values : ValuePairs :: ExistentialTraitRef ( ExpectedFound :: new ( true , a, b) ) ,
549484 }
550485 }
551486}
552487
553488impl < ' tcx > ToTrace < ' tcx > for ty:: PolyExistentialProjection < ' tcx > {
554- fn to_trace (
555- cause : & ObligationCause < ' tcx > ,
556- a_is_expected : bool ,
557- a : Self ,
558- b : Self ,
559- ) -> TypeTrace < ' tcx > {
489+ fn to_trace ( cause : & ObligationCause < ' tcx > , a : Self , b : Self ) -> TypeTrace < ' tcx > {
560490 TypeTrace {
561491 cause : cause. clone ( ) ,
562- values : ValuePairs :: ExistentialProjection ( ExpectedFound :: new ( a_is_expected , a, b) ) ,
492+ values : ValuePairs :: ExistentialProjection ( ExpectedFound :: new ( true , a, b) ) ,
563493 }
564494 }
565495}
0 commit comments