Improve type error message for non-constructor in pattern
This commit is contained in:
parent
1402cd101b
commit
24c9d7e5f8
@ -1128,8 +1128,8 @@ fn pushdown_pat(&@stmt_ctxt scx, &ty::t expected, &@ast::pat pat) {
|
||||
alt (struct(scx.fcx.ccx.tcx, expected)) {
|
||||
case (ty::ty_tag(_, ?tps)) { tag_tps = tps; }
|
||||
case (_) {
|
||||
log_err "tag pattern type not actually a tag?!";
|
||||
fail;
|
||||
scx.fcx.ccx.tcx.sess.span_err(pat.span,
|
||||
"Non-constructor used in a pattern");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user