Skip to content

Commit 9c4538b

Browse files
committed
---
yaml --- r: 961 b: refs/heads/master c: 416d9bc h: refs/heads/master i: 959: 0db4a83 v: v3
1 parent 4d28823 commit 9c4538b

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: f0abe8f568044885c7c5b24c148bf1c2b117ef01
2+
refs/heads/master: 416d9bc0fd20c87dc4ed96e2018156e65fea1e2b

trunk/src/comp/middle/typeck.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -408,18 +408,25 @@ fn field_num(session.session sess, &span sp, &ast.ident id) -> uint {
408408
let uint i = 0u;
409409
for (u8 c in id) {
410410
if (i == 0u) {
411-
if (c != '_' as u8) {
412-
sess.span_err(sp, "bad numeric field on tuple");
411+
if (c != ('_' as u8)) {
412+
sess.span_err(sp,
413+
"bad numeric field on tuple: "
414+
+ "missing leading underscore");
413415
}
414416
} else {
415-
i += 1u;
416417
if (('0' as u8) <= c && c <= ('9' as u8)) {
417418
accum *= 10u;
418419
accum += (c as uint) - ('0' as uint);
419420
} else {
420-
sess.span_err(sp, "bad numeric field on tuple");
421+
auto s = "";
422+
s += c;
423+
sess.span_err(sp,
424+
"bad numeric field on tuple: "
425+
+ " non-digit character: "
426+
+ s);
421427
}
422428
}
429+
i += 1u;
423430
}
424431
ret accum;
425432
}

0 commit comments

Comments
 (0)