@@ -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 } ;
@@ -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,
@@ -1495,7 +1495,7 @@ pub(super) trait InferCtxtPrivExt<'tcx> {
1495
1495
kind : ty:: ClosureKind ,
1496
1496
) -> DiagnosticBuilder < ' tcx > ;
1497
1497
1498
- fn report_type_parameter_mismatch_cyclic_type_error (
1498
+ fn report_cyclic_signature_error (
1499
1499
& self ,
1500
1500
obligation : & PredicateObligation < ' tcx > ,
1501
1501
found_trait_ref : ty:: Binder < ' tcx , ty:: TraitRef < ' tcx > > ,
@@ -1509,7 +1509,7 @@ pub(super) trait InferCtxtPrivExt<'tcx> {
1509
1509
def_id : DefId ,
1510
1510
) -> DiagnosticBuilder < ' tcx > ;
1511
1511
1512
- fn report_type_parameter_mismatch_error (
1512
+ fn report_signature_mismatch_error (
1513
1513
& self ,
1514
1514
obligation : & PredicateObligation < ' tcx > ,
1515
1515
span : Span ,
@@ -3369,7 +3369,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
3369
3369
self . dcx ( ) . create_err ( err)
3370
3370
}
3371
3371
3372
- fn report_type_parameter_mismatch_cyclic_type_error (
3372
+ fn report_cyclic_signature_error (
3373
3373
& self ,
3374
3374
obligation : & PredicateObligation < ' tcx > ,
3375
3375
found_trait_ref : ty:: Binder < ' tcx , ty:: TraitRef < ' tcx > > ,
@@ -3430,7 +3430,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
3430
3430
err
3431
3431
}
3432
3432
3433
- fn report_type_parameter_mismatch_error (
3433
+ fn report_signature_mismatch_error (
3434
3434
& self ,
3435
3435
obligation : & PredicateObligation < ' tcx > ,
3436
3436
span : Span ,
@@ -3449,10 +3449,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
3449
3449
} ;
3450
3450
3451
3451
let found_did = match * found_trait_ty. kind ( ) {
3452
- ty:: Closure ( did, _) | ty:: Foreign ( did) | ty:: FnDef ( did, _) | ty:: Coroutine ( did, ..) => {
3453
- Some ( did)
3454
- }
3455
- ty:: Adt ( def, _) => Some ( def. did ( ) ) ,
3452
+ ty:: Closure ( did, _) | ty:: FnDef ( did, _) | ty:: Coroutine ( did, ..) => Some ( did) ,
3456
3453
_ => None ,
3457
3454
} ;
3458
3455
0 commit comments