@@ -14,8 +14,8 @@ use crate::traits::specialize::to_pretty_impl_header;
1414use crate :: traits:: NormalizeExt ;
1515use crate :: traits:: {
1616 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 ,
1919} ;
2020use rustc_data_structures:: fx:: { FxHashMap , FxIndexMap } ;
2121use rustc_errors:: {
@@ -30,7 +30,7 @@ use rustc_hir::{GenericParam, Item, Node};
3030use rustc_infer:: infer:: error_reporting:: TypeErrCtxt ;
3131use rustc_infer:: infer:: { InferOk , TypeTrace } ;
3232use rustc_middle:: traits:: select:: OverflowError ;
33- use rustc_middle:: traits:: { DefiningAnchor , SelectionOutputTypeParameterMismatch } ;
33+ use rustc_middle:: traits:: { DefiningAnchor , SignatureMismatchData } ;
3434use rustc_middle:: ty:: abstract_const:: NotConstEvaluatable ;
3535use rustc_middle:: ty:: error:: { ExpectedFound , TypeError } ;
3636use rustc_middle:: ty:: fold:: { BottomUpFolder , TypeFolder , TypeSuperFoldable } ;
@@ -891,22 +891,22 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
891891 }
892892 }
893893
894- OutputTypeParameterMismatch ( box SelectionOutputTypeParameterMismatch {
894+ SignatureMismatch ( box SignatureMismatchData {
895895 found_trait_ref,
896896 expected_trait_ref,
897897 terr : terr @ TypeError :: CyclicTy ( _) ,
898- } ) => self . report_type_parameter_mismatch_cyclic_type_error (
898+ } ) => self . report_cyclic_signature_error (
899899 & obligation,
900900 found_trait_ref,
901901 expected_trait_ref,
902902 terr,
903903 ) ,
904- OutputTypeParameterMismatch ( box SelectionOutputTypeParameterMismatch {
904+ SignatureMismatch ( box SignatureMismatchData {
905905 found_trait_ref,
906906 expected_trait_ref,
907907 terr : _,
908908 } ) => {
909- match self . report_type_parameter_mismatch_error (
909+ match self . report_signature_mismatch_error (
910910 & obligation,
911911 span,
912912 found_trait_ref,
@@ -1495,7 +1495,7 @@ pub(super) trait InferCtxtPrivExt<'tcx> {
14951495 kind : ty:: ClosureKind ,
14961496 ) -> DiagnosticBuilder < ' tcx > ;
14971497
1498- fn report_type_parameter_mismatch_cyclic_type_error (
1498+ fn report_cyclic_signature_error (
14991499 & self ,
15001500 obligation : & PredicateObligation < ' tcx > ,
15011501 found_trait_ref : ty:: Binder < ' tcx , ty:: TraitRef < ' tcx > > ,
@@ -1509,7 +1509,7 @@ pub(super) trait InferCtxtPrivExt<'tcx> {
15091509 def_id : DefId ,
15101510 ) -> DiagnosticBuilder < ' tcx > ;
15111511
1512- fn report_type_parameter_mismatch_error (
1512+ fn report_signature_mismatch_error (
15131513 & self ,
15141514 obligation : & PredicateObligation < ' tcx > ,
15151515 span : Span ,
@@ -3369,7 +3369,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
33693369 self . dcx ( ) . create_err ( err)
33703370 }
33713371
3372- fn report_type_parameter_mismatch_cyclic_type_error (
3372+ fn report_cyclic_signature_error (
33733373 & self ,
33743374 obligation : & PredicateObligation < ' tcx > ,
33753375 found_trait_ref : ty:: Binder < ' tcx , ty:: TraitRef < ' tcx > > ,
@@ -3430,7 +3430,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
34303430 err
34313431 }
34323432
3433- fn report_type_parameter_mismatch_error (
3433+ fn report_signature_mismatch_error (
34343434 & self ,
34353435 obligation : & PredicateObligation < ' tcx > ,
34363436 span : Span ,
@@ -3449,10 +3449,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
34493449 } ;
34503450
34513451 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) ,
34563453 _ => None ,
34573454 } ;
34583455
0 commit comments