diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-12-30 07:42:46 +0100 |
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-12-30 13:50:20 +0100 |
| commit | e952377ddc7bdddfee03ee09f3530a1c025f1d99 (patch) | |
| tree | 4ef7b94f3ed3210f9b145e68b2e4f8a53b194dfa /src | |
| parent | 960acb044bcefc46520cee263b6877160fd296ca (diff) | |
| download | rust-e952377ddc7bdddfee03ee09f3530a1c025f1d99.tar.gz rust-e952377ddc7bdddfee03ee09f3530a1c025f1d99.zip | |
MatchExpressionArmPattern -> Pattern
Current name is too specific for incoming changes.
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc/infer/error_reporting/mod.rs | 2 | ||||
| -rw-r--r-- | src/librustc/traits/error_reporting.rs | 2 | ||||
| -rw-r--r-- | src/librustc/traits/mod.rs | 4 | ||||
| -rw-r--r-- | src/librustc/traits/structural_impls.rs | 4 | ||||
| -rw-r--r-- | src/librustc_typeck/check/demand.rs | 5 |
5 files changed, 6 insertions, 11 deletions
diff --git a/src/librustc/infer/error_reporting/mod.rs b/src/librustc/infer/error_reporting/mod.rs index f0f0e2cdeb9..ae629adf8fb 100644 --- a/src/librustc/infer/error_reporting/mod.rs +++ b/src/librustc/infer/error_reporting/mod.rs @@ -581,7 +581,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { exp_found: Option<ty::error::ExpectedFound<Ty<'tcx>>>, ) { match cause.code { - ObligationCauseCode::MatchExpressionArmPattern { span, ty } => { + ObligationCauseCode::Pattern { span, ty } => { if ty.is_suggestable() { // don't show type `_` err.span_label(span, format!("this expression has type `{}`", ty)); diff --git a/src/librustc/traits/error_reporting.rs b/src/librustc/traits/error_reporting.rs index 878675f9812..5819e7aa5c2 100644 --- a/src/librustc/traits/error_reporting.rs +++ b/src/librustc/traits/error_reporting.rs @@ -2580,7 +2580,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { match *cause_code { ObligationCauseCode::ExprAssignable | ObligationCauseCode::MatchExpressionArm { .. } - | ObligationCauseCode::MatchExpressionArmPattern { .. } + | ObligationCauseCode::Pattern { .. } | ObligationCauseCode::IfExpression { .. } | ObligationCauseCode::IfExpressionWithNoElse | ObligationCauseCode::MainFunctionType diff --git a/src/librustc/traits/mod.rs b/src/librustc/traits/mod.rs index e6ecf1b676e..6142dc25f22 100644 --- a/src/librustc/traits/mod.rs +++ b/src/librustc/traits/mod.rs @@ -249,8 +249,8 @@ pub enum ObligationCauseCode<'tcx> { /// Computing common supertype in the arms of a match expression MatchExpressionArm(Box<MatchExpressionArmCause<'tcx>>), - /// Computing common supertype in the pattern guard for the arms of a match expression - MatchExpressionArmPattern { + /// Type error arising from type checking a pattern against an expected type. + Pattern { span: Span, ty: Ty<'tcx>, }, diff --git a/src/librustc/traits/structural_impls.rs b/src/librustc/traits/structural_impls.rs index ed0842d8098..cfc27438b50 100644 --- a/src/librustc/traits/structural_impls.rs +++ b/src/librustc/traits/structural_impls.rs @@ -521,9 +521,7 @@ impl<'a, 'tcx> Lift<'tcx> for traits::ObligationCauseCode<'a> { discrim_hir_id, }) }), - super::MatchExpressionArmPattern { span, ty } => { - tcx.lift(&ty).map(|ty| super::MatchExpressionArmPattern { span, ty }) - } + super::Pattern { span, ty } => tcx.lift(&ty).map(|ty| super::Pattern { span, ty }), super::IfExpression(box super::IfExpressionCause { then, outer, semicolon }) => { Some(super::IfExpression(box super::IfExpressionCause { then, outer, semicolon })) } diff --git a/src/librustc_typeck/check/demand.rs b/src/librustc_typeck/check/demand.rs index 68f2943e9e1..c11bd6704e4 100644 --- a/src/librustc_typeck/check/demand.rs +++ b/src/librustc_typeck/check/demand.rs @@ -87,10 +87,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { match_expr_span: Option<Span>, ) -> Option<DiagnosticBuilder<'tcx>> { let cause = if let Some(span) = match_expr_span { - self.cause( - cause_span, - ObligationCauseCode::MatchExpressionArmPattern { span, ty: expected }, - ) + self.cause(cause_span, ObligationCauseCode::Pattern { span, ty: expected }) } else { self.misc(cause_span) }; |
