@@ -14,8 +14,8 @@ use crate::traits::specialize::to_pretty_impl_header;
14
14
use crate :: traits:: NormalizeExt ;
15
15
use crate :: traits:: {
16
16
elaborate, FulfillmentError , FulfillmentErrorCode , MismatchedProjectionTypes , Obligation ,
17
- ObligationCause , ObligationCauseCode , ObligationCtxt , OutputTypeParameterMismatch , Overflow ,
18
- PredicateObligation , SelectionError , TraitNotObjectSafe ,
17
+ ObligationCause , ObligationCauseCode , ObligationCtxt , Overflow , PredicateObligation ,
18
+ SelectionError , SignatureMismatch , TraitNotObjectSafe ,
19
19
} ;
20
20
use rustc_data_structures:: fx:: { FxHashMap , FxIndexMap } ;
21
21
use rustc_errors:: {
@@ -30,7 +30,7 @@ use rustc_hir::{GenericParam, Item, Node};
30
30
use rustc_infer:: infer:: error_reporting:: TypeErrCtxt ;
31
31
use rustc_infer:: infer:: { InferOk , TypeTrace } ;
32
32
use rustc_middle:: traits:: select:: OverflowError ;
33
- use rustc_middle:: traits:: { DefiningAnchor , SelectionOutputTypeParameterMismatch } ;
33
+ use rustc_middle:: traits:: { DefiningAnchor , SignatureMismatchData } ;
34
34
use rustc_middle:: ty:: abstract_const:: NotConstEvaluatable ;
35
35
use rustc_middle:: ty:: error:: { ExpectedFound , TypeError } ;
36
36
use rustc_middle:: ty:: fold:: { BottomUpFolder , TypeFolder , TypeSuperFoldable } ;
@@ -785,14 +785,14 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
785
785
786
786
ty:: PredicateKind :: Subtype ( predicate) => {
787
787
// Errors for Subtype predicates show up as
788
- // `FulfillmentErrorCode::CodeSubtypeError `,
788
+ // `FulfillmentErrorCode::SubtypeError `,
789
789
// not selection error.
790
790
span_bug ! ( span, "subtype requirement gave wrong error: `{:?}`" , predicate)
791
791
}
792
792
793
793
ty:: PredicateKind :: Coerce ( predicate) => {
794
794
// Errors for Coerce predicates show up as
795
- // `FulfillmentErrorCode::CodeSubtypeError `,
795
+ // `FulfillmentErrorCode::SubtypeError `,
796
796
// not selection error.
797
797
span_bug ! ( span, "coerce requirement gave wrong error: `{:?}`" , predicate)
798
798
}
@@ -891,22 +891,22 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
891
891
}
892
892
}
893
893
894
- OutputTypeParameterMismatch ( box SelectionOutputTypeParameterMismatch {
894
+ SignatureMismatch ( box SignatureMismatchData {
895
895
found_trait_ref,
896
896
expected_trait_ref,
897
897
terr : terr @ TypeError :: CyclicTy ( _) ,
898
- } ) => self . report_type_parameter_mismatch_cyclic_type_error (
898
+ } ) => self . report_cyclic_signature_error (
899
899
& obligation,
900
900
found_trait_ref,
901
901
expected_trait_ref,
902
902
terr,
903
903
) ,
904
- OutputTypeParameterMismatch ( box SelectionOutputTypeParameterMismatch {
904
+ SignatureMismatch ( box SignatureMismatchData {
905
905
found_trait_ref,
906
906
expected_trait_ref,
907
907
terr : _,
908
908
} ) => {
909
- match self . report_type_parameter_mismatch_error (
909
+ match self . report_signature_mismatch_error (
910
910
& obligation,
911
911
span,
912
912
found_trait_ref,
@@ -1492,7 +1492,7 @@ pub(super) trait InferCtxtPrivExt<'tcx> {
1492
1492
kind : ty:: ClosureKind ,
1493
1493
) -> DiagnosticBuilder < ' tcx > ;
1494
1494
1495
- fn report_type_parameter_mismatch_cyclic_type_error (
1495
+ fn report_cyclic_signature_error (
1496
1496
& self ,
1497
1497
obligation : & PredicateObligation < ' tcx > ,
1498
1498
found_trait_ref : ty:: Binder < ' tcx , ty:: TraitRef < ' tcx > > ,
@@ -1506,7 +1506,7 @@ pub(super) trait InferCtxtPrivExt<'tcx> {
1506
1506
def_id : DefId ,
1507
1507
) -> DiagnosticBuilder < ' tcx > ;
1508
1508
1509
- fn report_type_parameter_mismatch_error (
1509
+ fn report_signature_mismatch_error (
1510
1510
& self ,
1511
1511
obligation : & PredicateObligation < ' tcx > ,
1512
1512
span : Span ,
@@ -1572,23 +1572,23 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
1572
1572
}
1573
1573
1574
1574
match error. code {
1575
- FulfillmentErrorCode :: CodeSelectionError ( ref selection_error) => {
1575
+ FulfillmentErrorCode :: SelectionError ( ref selection_error) => {
1576
1576
self . report_selection_error (
1577
1577
error. obligation . clone ( ) ,
1578
1578
& error. root_obligation ,
1579
1579
selection_error,
1580
1580
) ;
1581
1581
}
1582
- FulfillmentErrorCode :: CodeProjectionError ( ref e) => {
1582
+ FulfillmentErrorCode :: ProjectionError ( ref e) => {
1583
1583
self . report_projection_error ( & error. obligation , e) ;
1584
1584
}
1585
- FulfillmentErrorCode :: CodeAmbiguity { overflow : false } => {
1585
+ FulfillmentErrorCode :: Ambiguity { overflow : false } => {
1586
1586
self . maybe_report_ambiguity ( & error. obligation ) ;
1587
1587
}
1588
- FulfillmentErrorCode :: CodeAmbiguity { overflow : true } => {
1588
+ FulfillmentErrorCode :: Ambiguity { overflow : true } => {
1589
1589
self . report_overflow_no_abort ( error. obligation . clone ( ) ) ;
1590
1590
}
1591
- FulfillmentErrorCode :: CodeSubtypeError ( ref expected_found, ref err) => {
1591
+ FulfillmentErrorCode :: SubtypeError ( ref expected_found, ref err) => {
1592
1592
self . report_mismatched_types (
1593
1593
& error. obligation . cause ,
1594
1594
expected_found. expected ,
@@ -1597,7 +1597,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
1597
1597
)
1598
1598
. emit ( ) ;
1599
1599
}
1600
- FulfillmentErrorCode :: CodeConstEquateError ( ref expected_found, ref err) => {
1600
+ FulfillmentErrorCode :: ConstEquateError ( ref expected_found, ref err) => {
1601
1601
let mut diag = self . report_mismatched_consts (
1602
1602
& error. obligation . cause ,
1603
1603
expected_found. expected ,
@@ -1622,7 +1622,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
1622
1622
}
1623
1623
diag. emit ( ) ;
1624
1624
}
1625
- FulfillmentErrorCode :: CodeCycle ( ref cycle) => {
1625
+ FulfillmentErrorCode :: Cycle ( ref cycle) => {
1626
1626
self . report_overflow_obligation_cycle ( cycle) ;
1627
1627
}
1628
1628
}
@@ -3366,7 +3366,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
3366
3366
self . dcx ( ) . create_err ( err)
3367
3367
}
3368
3368
3369
- fn report_type_parameter_mismatch_cyclic_type_error (
3369
+ fn report_cyclic_signature_error (
3370
3370
& self ,
3371
3371
obligation : & PredicateObligation < ' tcx > ,
3372
3372
found_trait_ref : ty:: Binder < ' tcx , ty:: TraitRef < ' tcx > > ,
@@ -3427,7 +3427,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
3427
3427
err
3428
3428
}
3429
3429
3430
- fn report_type_parameter_mismatch_error (
3430
+ fn report_signature_mismatch_error (
3431
3431
& self ,
3432
3432
obligation : & PredicateObligation < ' tcx > ,
3433
3433
span : Span ,
@@ -3446,10 +3446,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
3446
3446
} ;
3447
3447
3448
3448
let found_did = match * found_trait_ty. kind ( ) {
3449
- ty:: Closure ( did, _) | ty:: Foreign ( did) | ty:: FnDef ( did, _) | ty:: Coroutine ( did, ..) => {
3450
- Some ( did)
3451
- }
3452
- ty:: Adt ( def, _) => Some ( def. did ( ) ) ,
3449
+ ty:: Closure ( did, _) | ty:: FnDef ( did, _) | ty:: Coroutine ( did, ..) => Some ( did) ,
3453
3450
_ => None ,
3454
3451
} ;
3455
3452
0 commit comments