Skip to content

Commit e952377

Browse files
committed
MatchExpressionArmPattern -> Pattern
Current name is too specific for incoming changes.
1 parent 960acb0 commit e952377

File tree

5 files changed

+6
-11
lines changed

5 files changed

+6
-11
lines changed

src/librustc/infer/error_reporting/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
581581
exp_found: Option<ty::error::ExpectedFound<Ty<'tcx>>>,
582582
) {
583583
match cause.code {
584-
ObligationCauseCode::MatchExpressionArmPattern { span, ty } => {
584+
ObligationCauseCode::Pattern { span, ty } => {
585585
if ty.is_suggestable() {
586586
// don't show type `_`
587587
err.span_label(span, format!("this expression has type `{}`", ty));

src/librustc/traits/error_reporting.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2580,7 +2580,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
25802580
match *cause_code {
25812581
ObligationCauseCode::ExprAssignable
25822582
| ObligationCauseCode::MatchExpressionArm { .. }
2583-
| ObligationCauseCode::MatchExpressionArmPattern { .. }
2583+
| ObligationCauseCode::Pattern { .. }
25842584
| ObligationCauseCode::IfExpression { .. }
25852585
| ObligationCauseCode::IfExpressionWithNoElse
25862586
| ObligationCauseCode::MainFunctionType

src/librustc/traits/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,8 @@ pub enum ObligationCauseCode<'tcx> {
249249
/// Computing common supertype in the arms of a match expression
250250
MatchExpressionArm(Box<MatchExpressionArmCause<'tcx>>),
251251

252-
/// Computing common supertype in the pattern guard for the arms of a match expression
253-
MatchExpressionArmPattern {
252+
/// Type error arising from type checking a pattern against an expected type.
253+
Pattern {
254254
span: Span,
255255
ty: Ty<'tcx>,
256256
},

src/librustc/traits/structural_impls.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -521,9 +521,7 @@ impl<'a, 'tcx> Lift<'tcx> for traits::ObligationCauseCode<'a> {
521521
discrim_hir_id,
522522
})
523523
}),
524-
super::MatchExpressionArmPattern { span, ty } => {
525-
tcx.lift(&ty).map(|ty| super::MatchExpressionArmPattern { span, ty })
526-
}
524+
super::Pattern { span, ty } => tcx.lift(&ty).map(|ty| super::Pattern { span, ty }),
527525
super::IfExpression(box super::IfExpressionCause { then, outer, semicolon }) => {
528526
Some(super::IfExpression(box super::IfExpressionCause { then, outer, semicolon }))
529527
}

src/librustc_typeck/check/demand.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
8787
match_expr_span: Option<Span>,
8888
) -> Option<DiagnosticBuilder<'tcx>> {
8989
let cause = if let Some(span) = match_expr_span {
90-
self.cause(
91-
cause_span,
92-
ObligationCauseCode::MatchExpressionArmPattern { span, ty: expected },
93-
)
90+
self.cause(cause_span, ObligationCauseCode::Pattern { span, ty: expected })
9491
} else {
9592
self.misc(cause_span)
9693
};

0 commit comments

Comments
 (0)