Skip to content

Commit 3c200f3

Browse files
committed
rustc: Grammar police work in check_pat() error messages
1 parent 0a22a4e commit 3c200f3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/comp/middle/typeck.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,8 +1467,9 @@ fn check_pat(&@fn_ctxt fcx, @ast.pat pat) -> @ast.pat {
14671467
// TODO: pluralize properly
14681468
auto err_msg = "tag type " + last_id + " has " +
14691469
_uint.to_str(subpats_len, 10u) +
1470-
" fields, but this pattern has " +
1471-
_uint.to_str(arg_len, 10u) + " fields";
1470+
" field(s), but this pattern has " +
1471+
_uint.to_str(arg_len, 10u) +
1472+
" field(s)";
14721473

14731474
fcx.ccx.sess.span_err(pat.span, err_msg);
14741475
fail; // TODO: recover
@@ -1491,10 +1492,10 @@ fn check_pat(&@fn_ctxt fcx, @ast.pat pat) -> @ast.pat {
14911492
if (subpats_len > 0u) {
14921493
// TODO: pluralize properly
14931494
auto err_msg = "tag type " + last_id +
1494-
" has no fields," +
1495+
" has no field(s)," +
14951496
" but this pattern has " +
14961497
_uint.to_str(subpats_len, 10u) +
1497-
" fields";
1498+
" field(s)";
14981499

14991500
fcx.ccx.sess.span_err(pat.span, err_msg);
15001501
fail; // TODO: recover

0 commit comments

Comments
 (0)