@@ -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 } ;
@@ -785,14 +785,14 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
785785
786786 ty:: PredicateKind :: Subtype ( predicate) => {
787787 // Errors for Subtype predicates show up as
788- // `FulfillmentErrorCode::CodeSubtypeError `,
788+ // `FulfillmentErrorCode::SubtypeError `,
789789 // not selection error.
790790 span_bug ! ( span, "subtype requirement gave wrong error: `{:?}`" , predicate)
791791 }
792792
793793 ty:: PredicateKind :: Coerce ( predicate) => {
794794 // Errors for Coerce predicates show up as
795- // `FulfillmentErrorCode::CodeSubtypeError `,
795+ // `FulfillmentErrorCode::SubtypeError `,
796796 // not selection error.
797797 span_bug ! ( span, "coerce requirement gave wrong error: `{:?}`" , predicate)
798798 }
@@ -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,
@@ -1492,7 +1492,7 @@ pub(super) trait InferCtxtPrivExt<'tcx> {
14921492 kind : ty:: ClosureKind ,
14931493 ) -> DiagnosticBuilder < ' tcx > ;
14941494
1495- fn report_type_parameter_mismatch_cyclic_type_error (
1495+ fn report_cyclic_signature_error (
14961496 & self ,
14971497 obligation : & PredicateObligation < ' tcx > ,
14981498 found_trait_ref : ty:: Binder < ' tcx , ty:: TraitRef < ' tcx > > ,
@@ -1506,7 +1506,7 @@ pub(super) trait InferCtxtPrivExt<'tcx> {
15061506 def_id : DefId ,
15071507 ) -> DiagnosticBuilder < ' tcx > ;
15081508
1509- fn report_type_parameter_mismatch_error (
1509+ fn report_signature_mismatch_error (
15101510 & self ,
15111511 obligation : & PredicateObligation < ' tcx > ,
15121512 span : Span ,
@@ -1572,23 +1572,23 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
15721572 }
15731573
15741574 match error. code {
1575- FulfillmentErrorCode :: CodeSelectionError ( ref selection_error) => {
1575+ FulfillmentErrorCode :: SelectionError ( ref selection_error) => {
15761576 self . report_selection_error (
15771577 error. obligation . clone ( ) ,
15781578 & error. root_obligation ,
15791579 selection_error,
15801580 ) ;
15811581 }
1582- FulfillmentErrorCode :: CodeProjectionError ( ref e) => {
1582+ FulfillmentErrorCode :: ProjectionError ( ref e) => {
15831583 self . report_projection_error ( & error. obligation , e) ;
15841584 }
1585- FulfillmentErrorCode :: CodeAmbiguity { overflow : false } => {
1585+ FulfillmentErrorCode :: Ambiguity { overflow : false } => {
15861586 self . maybe_report_ambiguity ( & error. obligation ) ;
15871587 }
1588- FulfillmentErrorCode :: CodeAmbiguity { overflow : true } => {
1588+ FulfillmentErrorCode :: Ambiguity { overflow : true } => {
15891589 self . report_overflow_no_abort ( error. obligation . clone ( ) ) ;
15901590 }
1591- FulfillmentErrorCode :: CodeSubtypeError ( ref expected_found, ref err) => {
1591+ FulfillmentErrorCode :: SubtypeError ( ref expected_found, ref err) => {
15921592 self . report_mismatched_types (
15931593 & error. obligation . cause ,
15941594 expected_found. expected ,
@@ -1597,7 +1597,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
15971597 )
15981598 . emit ( ) ;
15991599 }
1600- FulfillmentErrorCode :: CodeConstEquateError ( ref expected_found, ref err) => {
1600+ FulfillmentErrorCode :: ConstEquateError ( ref expected_found, ref err) => {
16011601 let mut diag = self . report_mismatched_consts (
16021602 & error. obligation . cause ,
16031603 expected_found. expected ,
@@ -1622,7 +1622,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
16221622 }
16231623 diag. emit ( ) ;
16241624 }
1625- FulfillmentErrorCode :: CodeCycle ( ref cycle) => {
1625+ FulfillmentErrorCode :: Cycle ( ref cycle) => {
16261626 self . report_overflow_obligation_cycle ( cycle) ;
16271627 }
16281628 }
@@ -3366,7 +3366,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
33663366 self . dcx ( ) . create_err ( err)
33673367 }
33683368
3369- fn report_type_parameter_mismatch_cyclic_type_error (
3369+ fn report_cyclic_signature_error (
33703370 & self ,
33713371 obligation : & PredicateObligation < ' tcx > ,
33723372 found_trait_ref : ty:: Binder < ' tcx , ty:: TraitRef < ' tcx > > ,
@@ -3427,7 +3427,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
34273427 err
34283428 }
34293429
3430- fn report_type_parameter_mismatch_error (
3430+ fn report_signature_mismatch_error (
34313431 & self ,
34323432 obligation : & PredicateObligation < ' tcx > ,
34333433 span : Span ,
@@ -3446,10 +3446,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
34463446 } ;
34473447
34483448 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) ,
34533450 _ => None ,
34543451 } ;
34553452
0 commit comments