auto merge of #14743 : Sawyer47/rust/range-msg, r=huonw

Range allows char and numeric types, but previous error message
mentioned only numeric types.
This commit is contained in:
bors 2014-06-08 00:46:57 -07:00
commit 7580ef902e
2 changed files with 3 additions and 2 deletions

View File

@ -460,7 +460,8 @@ pub fn check_pat(pcx: &pat_ctxt, pat: &ast::Pat, expected: ty::t) {
{
// no-op
} else if !ty::type_is_numeric(b_ty) && !ty::type_is_char(b_ty) {
tcx.sess.span_err(pat.span, "non-numeric type used in range");
tcx.sess.span_err(pat.span,
"only char and numeric types are allowed in range");
} else {
match valid_range_bounds(fcx.ccx, begin, end) {
Some(false) => {

View File

@ -9,7 +9,7 @@
// except according to those terms.
//error-pattern: lower range bound
//error-pattern: non-numeric
//error-pattern: only char and numeric types
//error-pattern: mismatched types
fn main() {