diff options
| author | Patrick Walton <[email protected]> | 2011-03-09 10:21:48 -0800 |
|---|---|---|
| committer | Patrick Walton <[email protected]> | 2011-03-09 10:21:48 -0800 |
| commit | 3c200f3e14ff618431ea12c52031da43ee651984 (patch) | |
| tree | fa0d7e8b585ec673e4f81a12fd03867712aefd03 /src/comp | |
| parent | rustc: Factor out path type instantiation so that tag patterns can use it as ... (diff) | |
| download | rust-3c200f3e14ff618431ea12c52031da43ee651984.tar.xz rust-3c200f3e14ff618431ea12c52031da43ee651984.zip | |
rustc: Grammar police work in check_pat() error messages
Diffstat (limited to 'src/comp')
| -rw-r--r-- | src/comp/middle/typeck.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/comp/middle/typeck.rs b/src/comp/middle/typeck.rs index e035e733..ae995491 100644 --- a/src/comp/middle/typeck.rs +++ b/src/comp/middle/typeck.rs @@ -1467,8 +1467,9 @@ fn check_pat(&@fn_ctxt fcx, @ast.pat pat) -> @ast.pat { // TODO: pluralize properly auto err_msg = "tag type " + last_id + " has " + _uint.to_str(subpats_len, 10u) + - " fields, but this pattern has " + - _uint.to_str(arg_len, 10u) + " fields"; + " field(s), but this pattern has " + + _uint.to_str(arg_len, 10u) + + " field(s)"; fcx.ccx.sess.span_err(pat.span, err_msg); fail; // TODO: recover @@ -1491,10 +1492,10 @@ fn check_pat(&@fn_ctxt fcx, @ast.pat pat) -> @ast.pat { if (subpats_len > 0u) { // TODO: pluralize properly auto err_msg = "tag type " + last_id + - " has no fields," + + " has no field(s)," + " but this pattern has " + _uint.to_str(subpats_len, 10u) + - " fields"; + " field(s)"; fcx.ccx.sess.span_err(pat.span, err_msg); fail; // TODO: recover |