@@ -92,12 +92,7 @@ impl<'tcx> InferCtxt<'tcx> {
92
92
}
93
93
94
94
pub 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 > ;
101
96
}
102
97
103
98
impl < ' a , ' tcx > At < ' a , ' tcx > {
@@ -116,7 +111,7 @@ impl<'a, 'tcx> At<'a, 'tcx> {
116
111
{
117
112
let mut fields = CombineFields :: new (
118
113
self . infcx ,
119
- ToTrace :: to_trace ( self . cause , true , expected, actual) ,
114
+ ToTrace :: to_trace ( self . cause , expected, actual) ,
120
115
self . param_env ,
121
116
define_opaque_types,
122
117
) ;
@@ -136,7 +131,7 @@ impl<'a, 'tcx> At<'a, 'tcx> {
136
131
{
137
132
let mut fields = CombineFields :: new (
138
133
self . infcx ,
139
- ToTrace :: to_trace ( self . cause , true , expected, actual) ,
134
+ ToTrace :: to_trace ( self . cause , expected, actual) ,
140
135
self . param_env ,
141
136
define_opaque_types,
142
137
) ;
@@ -156,7 +151,7 @@ impl<'a, 'tcx> At<'a, 'tcx> {
156
151
{
157
152
let mut fields = CombineFields :: new (
158
153
self . infcx ,
159
- ToTrace :: to_trace ( self . cause , true , expected, actual) ,
154
+ ToTrace :: to_trace ( self . cause , expected, actual) ,
160
155
self . param_env ,
161
156
define_opaque_types,
162
157
) ;
@@ -222,7 +217,7 @@ impl<'a, 'tcx> At<'a, 'tcx> {
222
217
assert ! ( self . infcx. next_trait_solver( ) ) ;
223
218
let mut fields = CombineFields :: new (
224
219
self . infcx ,
225
- ToTrace :: to_trace ( self . cause , true , expected, actual) ,
220
+ ToTrace :: to_trace ( self . cause , expected, actual) ,
226
221
self . param_env ,
227
222
DefineOpaqueTypes :: Yes ,
228
223
) ;
@@ -314,7 +309,7 @@ impl<'a, 'tcx> At<'a, 'tcx> {
314
309
{
315
310
let mut fields = CombineFields :: new (
316
311
self . infcx ,
317
- ToTrace :: to_trace ( self . cause , true , expected, actual) ,
312
+ ToTrace :: to_trace ( self . cause , expected, actual) ,
318
313
self . param_env ,
319
314
define_opaque_types,
320
315
) ;
@@ -336,7 +331,7 @@ impl<'a, 'tcx> At<'a, 'tcx> {
336
331
{
337
332
let mut fields = CombineFields :: new (
338
333
self . infcx ,
339
- ToTrace :: to_trace ( self . cause , true , expected, actual) ,
334
+ ToTrace :: to_trace ( self . cause , expected, actual) ,
340
335
self . param_env ,
341
336
define_opaque_types,
342
337
) ;
@@ -346,18 +341,13 @@ impl<'a, 'tcx> At<'a, 'tcx> {
346
341
}
347
342
348
343
impl < ' 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 > {
355
345
match ( a, b) {
356
346
( 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)
358
348
}
359
349
( 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)
361
351
}
362
352
( ImplSubject :: Trait ( _) , ImplSubject :: Inherent ( _) )
363
353
| ( ImplSubject :: Inherent ( _) , ImplSubject :: Trait ( _) ) => {
@@ -368,65 +358,45 @@ impl<'tcx> ToTrace<'tcx> for ImplSubject<'tcx> {
368
358
}
369
359
370
360
impl < ' 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 > {
377
362
TypeTrace {
378
363
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 ( ) ) ) ,
380
365
}
381
366
}
382
367
}
383
368
384
369
impl < ' 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 > {
391
371
TypeTrace {
392
372
cause : cause. clone ( ) ,
393
- values : ValuePairs :: Regions ( ExpectedFound :: new ( a_is_expected , a, b) ) ,
373
+ values : ValuePairs :: Regions ( ExpectedFound :: new ( true , a, b) ) ,
394
374
}
395
375
}
396
376
}
397
377
398
378
impl < ' 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 > {
405
380
TypeTrace {
406
381
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 ( ) ) ) ,
408
383
}
409
384
}
410
385
}
411
386
412
387
impl < ' 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 > {
419
389
TypeTrace {
420
390
cause : cause. clone ( ) ,
421
391
values : match ( a. unpack ( ) , b. unpack ( ) ) {
422
392
( GenericArgKind :: Lifetime ( a) , GenericArgKind :: Lifetime ( b) ) => {
423
- ValuePairs :: Regions ( ExpectedFound :: new ( a_is_expected , a, b) )
393
+ ValuePairs :: Regions ( ExpectedFound :: new ( true , a, b) )
424
394
}
425
395
( 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 ( ) ) )
427
397
}
428
398
( 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 ( ) ) )
430
400
}
431
401
432
402
(
@@ -449,72 +419,47 @@ impl<'tcx> ToTrace<'tcx> for ty::GenericArg<'tcx> {
449
419
}
450
420
451
421
impl < ' 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 > {
458
423
TypeTrace {
459
424
cause : cause. clone ( ) ,
460
- values : ValuePairs :: Terms ( ExpectedFound :: new ( a_is_expected , a, b) ) ,
425
+ values : ValuePairs :: Terms ( ExpectedFound :: new ( true , a, b) ) ,
461
426
}
462
427
}
463
428
}
464
429
465
430
impl < ' 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 > {
472
432
TypeTrace {
473
433
cause : cause. clone ( ) ,
474
- values : ValuePairs :: TraitRefs ( ExpectedFound :: new ( a_is_expected , a, b) ) ,
434
+ values : ValuePairs :: TraitRefs ( ExpectedFound :: new ( true , a, b) ) ,
475
435
}
476
436
}
477
437
}
478
438
479
439
impl < ' 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 > {
486
441
TypeTrace {
487
442
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 ( ) ) ) ,
489
444
}
490
445
}
491
446
}
492
447
493
448
impl < ' 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 > {
500
450
TypeTrace {
501
451
cause : cause. clone ( ) ,
502
- values : ValuePairs :: Aliases ( ExpectedFound :: new ( a_is_expected , a, b) ) ,
452
+ values : ValuePairs :: Aliases ( ExpectedFound :: new ( true , a, b) ) ,
503
453
}
504
454
}
505
455
}
506
456
507
457
impl < ' 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 > {
514
459
TypeTrace {
515
460
cause : cause. clone ( ) ,
516
461
values : ValuePairs :: PolySigs ( ExpectedFound :: new (
517
- a_is_expected ,
462
+ true ,
518
463
ty:: Binder :: dummy ( a) ,
519
464
ty:: Binder :: dummy ( b) ,
520
465
) ) ,
@@ -523,43 +468,28 @@ impl<'tcx> ToTrace<'tcx> for ty::FnSig<'tcx> {
523
468
}
524
469
525
470
impl < ' 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 > {
532
472
TypeTrace {
533
473
cause : cause. clone ( ) ,
534
- values : ValuePairs :: PolySigs ( ExpectedFound :: new ( a_is_expected , a, b) ) ,
474
+ values : ValuePairs :: PolySigs ( ExpectedFound :: new ( true , a, b) ) ,
535
475
}
536
476
}
537
477
}
538
478
539
479
impl < ' 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 > {
546
481
TypeTrace {
547
482
cause : cause. clone ( ) ,
548
- values : ValuePairs :: ExistentialTraitRef ( ExpectedFound :: new ( a_is_expected , a, b) ) ,
483
+ values : ValuePairs :: ExistentialTraitRef ( ExpectedFound :: new ( true , a, b) ) ,
549
484
}
550
485
}
551
486
}
552
487
553
488
impl < ' 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 > {
560
490
TypeTrace {
561
491
cause : cause. clone ( ) ,
562
- values : ValuePairs :: ExistentialProjection ( ExpectedFound :: new ( a_is_expected , a, b) ) ,
492
+ values : ValuePairs :: ExistentialProjection ( ExpectedFound :: new ( true , a, b) ) ,
563
493
}
564
494
}
565
495
}
0 commit comments