Skip to content

Commit 24c9d7e

Browse files
committed
Improve type error message for non-constructor in pattern
1 parent 1402cd1 commit 24c9d7e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/comp/middle/typeck.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,8 +1128,8 @@ mod pushdown {
11281128
alt (struct(scx.fcx.ccx.tcx, expected)) {
11291129
case (ty::ty_tag(_, ?tps)) { tag_tps = tps; }
11301130
case (_) {
1131-
log_err "tag pattern type not actually a tag?!";
1132-
fail;
1131+
scx.fcx.ccx.tcx.sess.span_err(pat.span,
1132+
"Non-constructor used in a pattern");
11331133
}
11341134
}
11351135

0 commit comments

Comments
 (0)