@@ -411,7 +411,7 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
411
411
412
412
ty:: PredicateKind :: ObjectSafe ( trait_def_id) => {
413
413
if !self . selcx . tcx ( ) . check_is_object_safe ( trait_def_id) {
414
- ProcessResult :: Error ( FulfillmentErrorCode :: SelectionError ( Unimplemented ) )
414
+ ProcessResult :: Error ( FulfillmentErrorCode :: Select ( Unimplemented ) )
415
415
} else {
416
416
ProcessResult :: Changed ( vec ! [ ] )
417
417
}
@@ -435,7 +435,7 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
435
435
ty,
436
436
) {
437
437
Ok ( inf_ok) => ProcessResult :: Changed ( mk_pending ( inf_ok. into_obligations ( ) ) ) ,
438
- Err ( _) => ProcessResult :: Error ( FulfillmentErrorCode :: SelectionError (
438
+ Err ( _) => ProcessResult :: Error ( FulfillmentErrorCode :: Select (
439
439
SelectionError :: Unimplemented ,
440
440
) ) ,
441
441
}
@@ -493,10 +493,7 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
493
493
Ok ( Err ( err) ) => {
494
494
let expected_found =
495
495
ExpectedFound :: new ( subtype. a_is_expected , subtype. a , subtype. b ) ;
496
- ProcessResult :: Error ( FulfillmentErrorCode :: SubtypeError (
497
- expected_found,
498
- err,
499
- ) )
496
+ ProcessResult :: Error ( FulfillmentErrorCode :: Subtype ( expected_found, err) )
500
497
}
501
498
}
502
499
}
@@ -516,10 +513,7 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
516
513
Ok ( Ok ( ok) ) => ProcessResult :: Changed ( mk_pending ( ok. obligations ) ) ,
517
514
Ok ( Err ( err) ) => {
518
515
let expected_found = ExpectedFound :: new ( false , coerce. a , coerce. b ) ;
519
- ProcessResult :: Error ( FulfillmentErrorCode :: SubtypeError (
520
- expected_found,
521
- err,
522
- ) )
516
+ ProcessResult :: Error ( FulfillmentErrorCode :: Subtype ( expected_found, err) )
523
517
}
524
518
}
525
519
}
@@ -542,7 +536,7 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
542
536
Err (
543
537
e @ NotConstEvaluatable :: MentionsParam
544
538
| e @ NotConstEvaluatable :: Error ( _) ,
545
- ) => ProcessResult :: Error ( FulfillmentErrorCode :: SelectionError (
539
+ ) => ProcessResult :: Error ( FulfillmentErrorCode :: Select (
546
540
SelectionError :: NotConstEvaluatable ( e) ,
547
541
) ) ,
548
542
}
@@ -638,29 +632,27 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
638
632
ProcessResult :: Changed ( mk_pending ( inf_ok. into_obligations ( ) ) )
639
633
}
640
634
Err ( err) => {
641
- ProcessResult :: Error ( FulfillmentErrorCode :: ConstEquateError (
635
+ ProcessResult :: Error ( FulfillmentErrorCode :: ConstEquate (
642
636
ExpectedFound :: new ( true , c1, c2) ,
643
637
err,
644
638
) )
645
639
}
646
640
}
647
641
}
648
642
( Err ( ErrorHandled :: Reported ( reported, _) ) , _)
649
- | ( _, Err ( ErrorHandled :: Reported ( reported, _) ) ) => {
650
- ProcessResult :: Error ( FulfillmentErrorCode :: SelectionError (
651
- SelectionError :: NotConstEvaluatable ( NotConstEvaluatable :: Error (
652
- reported. into ( ) ,
653
- ) ) ,
654
- ) )
655
- }
643
+ | ( _, Err ( ErrorHandled :: Reported ( reported, _) ) ) => ProcessResult :: Error (
644
+ FulfillmentErrorCode :: Select ( SelectionError :: NotConstEvaluatable (
645
+ NotConstEvaluatable :: Error ( reported. into ( ) ) ,
646
+ ) ) ,
647
+ ) ,
656
648
( Err ( ErrorHandled :: TooGeneric ( _) ) , _)
657
649
| ( _, Err ( ErrorHandled :: TooGeneric ( _) ) ) => {
658
650
if c1. has_non_region_infer ( ) || c2. has_non_region_infer ( ) {
659
651
ProcessResult :: Unchanged
660
652
} else {
661
653
// Two different constants using generic parameters ~> error.
662
654
let expected_found = ExpectedFound :: new ( true , c1, c2) ;
663
- ProcessResult :: Error ( FulfillmentErrorCode :: ConstEquateError (
655
+ ProcessResult :: Error ( FulfillmentErrorCode :: ConstEquate (
664
656
expected_found,
665
657
TypeError :: ConstMismatch ( expected_found) ,
666
658
) )
@@ -741,7 +733,7 @@ impl<'a, 'tcx> FulfillProcessor<'a, 'tcx> {
741
733
Err ( selection_err) => {
742
734
debug ! ( "selecting trait at depth {} yielded Err" , obligation. recursion_depth) ;
743
735
744
- ProcessResult :: Error ( FulfillmentErrorCode :: SelectionError ( selection_err) )
736
+ ProcessResult :: Error ( FulfillmentErrorCode :: Select ( selection_err) )
745
737
}
746
738
}
747
739
}
@@ -793,7 +785,7 @@ impl<'a, 'tcx> FulfillProcessor<'a, 'tcx> {
793
785
project_obligation. with( tcx, project_obligation. predicate) ,
794
786
] ) ) ,
795
787
ProjectAndUnifyResult :: MismatchedProjectionTypes ( e) => {
796
- ProcessResult :: Error ( FulfillmentErrorCode :: ProjectionError ( e) )
788
+ ProcessResult :: Error ( FulfillmentErrorCode :: Project ( e) )
797
789
}
798
790
}
799
791
}
0 commit comments