mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-04 04:39:16 +00:00
rustc: Grammar police work in check_pat() error messages
This commit is contained in:
parent
0a22a4edbb
commit
3c200f3e14
@ -1467,8 +1467,9 @@ fn check_pat(&@fn_ctxt fcx, @ast.pat pat) -> @ast.pat {
|
|||||||
// TODO: pluralize properly
|
// TODO: pluralize properly
|
||||||
auto err_msg = "tag type " + last_id + " has " +
|
auto err_msg = "tag type " + last_id + " has " +
|
||||||
_uint.to_str(subpats_len, 10u) +
|
_uint.to_str(subpats_len, 10u) +
|
||||||
" fields, but this pattern has " +
|
" field(s), but this pattern has " +
|
||||||
_uint.to_str(arg_len, 10u) + " fields";
|
_uint.to_str(arg_len, 10u) +
|
||||||
|
" field(s)";
|
||||||
|
|
||||||
fcx.ccx.sess.span_err(pat.span, err_msg);
|
fcx.ccx.sess.span_err(pat.span, err_msg);
|
||||||
fail; // TODO: recover
|
fail; // TODO: recover
|
||||||
@ -1491,10 +1492,10 @@ fn check_pat(&@fn_ctxt fcx, @ast.pat pat) -> @ast.pat {
|
|||||||
if (subpats_len > 0u) {
|
if (subpats_len > 0u) {
|
||||||
// TODO: pluralize properly
|
// TODO: pluralize properly
|
||||||
auto err_msg = "tag type " + last_id +
|
auto err_msg = "tag type " + last_id +
|
||||||
" has no fields," +
|
" has no field(s)," +
|
||||||
" but this pattern has " +
|
" but this pattern has " +
|
||||||
_uint.to_str(subpats_len, 10u) +
|
_uint.to_str(subpats_len, 10u) +
|
||||||
" fields";
|
" field(s)";
|
||||||
|
|
||||||
fcx.ccx.sess.span_err(pat.span, err_msg);
|
fcx.ccx.sess.span_err(pat.span, err_msg);
|
||||||
fail; // TODO: recover
|
fail; // TODO: recover
|
||||||
|
Loading…
Reference in New Issue
Block a user