Skip to content

Commit 892d265

Browse files
committed
---
yaml --- r: 152186 b: refs/heads/try2 c: 356423d h: refs/heads/master v: v3
1 parent 66d2b86 commit 892d265

File tree

6 files changed

+188
-200
lines changed

6 files changed

+188
-200
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 5527c5dc060754d7ca17c19886bc357ef29ec8fc
8+
refs/heads/try2: 356423d8f1c308f0dc77f803f8ed00c7e80305f3
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustc/middle/typeck/check/_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ pub fn check_match(fcx: &FnCtxt,
8787
result_ty =
8888
infer::common_supertype(
8989
fcx.infcx(),
90-
infer::MatchExpressionArm(expr.span, arm.body.span),
90+
infer::MatchExpression(expr.span),
9191
true, // result_ty is "expected" here
9292
result_ty,
9393
bty);

branches/try2/src/librustc/middle/typeck/infer/error_reporting.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ impl<'a> ErrorReporting for InferCtxt<'a> {
346346
infer::ExprAssignable(_) => "mismatched types",
347347
infer::RelateTraitRefs(_) => "mismatched traits",
348348
infer::RelateSelfType(_) => "mismatched types",
349-
infer::MatchExpressionArm(_, _) => "match arms have incompatible types",
349+
infer::MatchExpression(_) => "match arms have incompatible types",
350350
infer::IfExpression(_) => "if and else have incompatible types",
351351
};
352352

@@ -356,12 +356,6 @@ impl<'a> ErrorReporting for InferCtxt<'a> {
356356
message_root_str,
357357
expected_found_str,
358358
ty::type_err_to_str(self.tcx, terr)).as_slice());
359-
360-
match trace.origin {
361-
infer::MatchExpressionArm(_, arm_span) =>
362-
self.tcx.sess.span_note(arm_span, "match arm with an incompatible type"),
363-
_ => ()
364-
}
365359
}
366360

367361
fn report_and_explain_type_error(&self,
@@ -1287,7 +1281,7 @@ impl<'a> ErrorReportingHelpers for InferCtxt<'a> {
12871281
infer::RelateSelfType(_) => {
12881282
format!("type matches impl")
12891283
}
1290-
infer::MatchExpressionArm(_, _) => {
1284+
infer::MatchExpression(_) => {
12911285
format!("match arms have compatible types")
12921286
}
12931287
infer::IfExpression(_) => {

branches/try2/src/librustc/middle/typeck/infer/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ pub enum TypeOrigin {
116116
// Relating trait refs when resolving vtables
117117
RelateSelfType(Span),
118118

119-
// Computing common supertype in the arms of a match expression
120-
MatchExpressionArm(Span, Span),
119+
// Computing common supertype in a match expression
120+
MatchExpression(Span),
121121

122122
// Computing common supertype in an if expression
123123
IfExpression(Span),
@@ -831,7 +831,7 @@ impl TypeOrigin {
831831
Misc(span) => span,
832832
RelateTraitRefs(span) => span,
833833
RelateSelfType(span) => span,
834-
MatchExpressionArm(match_span, _) => match_span,
834+
MatchExpression(span) => span,
835835
IfExpression(span) => span,
836836
}
837837
}
@@ -853,8 +853,8 @@ impl Repr for TypeOrigin {
853853
RelateSelfType(a) => {
854854
format!("RelateSelfType({})", a.repr(tcx))
855855
}
856-
MatchExpressionArm(a, b) => {
857-
format!("MatchExpressionArm({}, {})", a.repr(tcx), b.repr(tcx))
856+
MatchExpression(a) => {
857+
format!("MatchExpression({})", a.repr(tcx))
858858
}
859859
IfExpression(a) => {
860860
format!("IfExpression({})", a.repr(tcx))

0 commit comments

Comments
 (0)