@@ -745,8 +745,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
745
745
}
746
746
ObligationCauseCode :: BlockTailExpression (
747
747
_,
748
- scrut_hir_id,
749
- hir:: MatchSource :: TryDesugar ,
748
+ hir:: MatchSource :: TryDesugar ( scrut_hir_id) ,
750
749
) => {
751
750
if let Some ( ty:: error:: ExpectedFound { expected, .. } ) = exp_found {
752
751
let scrut_expr = self . tcx . hir ( ) . expect_expr ( scrut_hir_id) ;
@@ -782,12 +781,11 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
782
781
prior_arm_ty,
783
782
source,
784
783
ref prior_arms,
785
- scrut_hir_id,
786
784
opt_suggest_box_span,
787
785
scrut_span,
788
786
..
789
787
} ) => match source {
790
- hir:: MatchSource :: TryDesugar => {
788
+ hir:: MatchSource :: TryDesugar ( scrut_hir_id ) => {
791
789
if let Some ( ty:: error:: ExpectedFound { expected, .. } ) = exp_found {
792
790
let scrut_expr = self . tcx . hir ( ) . expect_expr ( scrut_hir_id) ;
793
791
let scrut_ty = if let hir:: ExprKind :: Call ( _, args) = & scrut_expr. kind {
@@ -2077,7 +2075,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
2077
2075
if let & ( MatchExpressionArm ( box MatchExpressionArmCause { source, .. } )
2078
2076
| BlockTailExpression ( .., source)
2079
2077
) = code
2080
- && let hir:: MatchSource :: TryDesugar = source
2078
+ && let hir:: MatchSource :: TryDesugar ( _ ) = source
2081
2079
&& let Some ( ( expected_ty, found_ty, _, _) ) = self . values_str ( trace. values )
2082
2080
{
2083
2081
suggestions. push ( TypeErrorAdditionalDiags :: TryCannotConvert {
@@ -2954,11 +2952,11 @@ impl<'tcx> ObligationCauseExt<'tcx> for ObligationCause<'tcx> {
2954
2952
CompareImplItemObligation { kind : ty:: AssocKind :: Const , .. } => {
2955
2953
ObligationCauseFailureCode :: ConstCompat { span, subdiags }
2956
2954
}
2957
- BlockTailExpression ( .., hir:: MatchSource :: TryDesugar ) => {
2955
+ BlockTailExpression ( .., hir:: MatchSource :: TryDesugar ( _ ) ) => {
2958
2956
ObligationCauseFailureCode :: TryCompat { span, subdiags }
2959
2957
}
2960
2958
MatchExpressionArm ( box MatchExpressionArmCause { source, .. } ) => match source {
2961
- hir:: MatchSource :: TryDesugar => {
2959
+ hir:: MatchSource :: TryDesugar ( _ ) => {
2962
2960
ObligationCauseFailureCode :: TryCompat { span, subdiags }
2963
2961
}
2964
2962
_ => ObligationCauseFailureCode :: MatchCompat { span, subdiags } ,
0 commit comments