about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-07-30 16:09:42 -0700
committerBrian Anderson <banderson@mozilla.com>2012-07-30 16:09:52 -0700
commitef29f7ff3659712bc045e47778c45ebe504f1387 (patch)
treed9f6b936ff01144060de2537dfae6ab630113000
parent416584d3398bb1659b5dcc987f13e42fd4086486 (diff)
downloadrust-ef29f7ff3659712bc045e47778c45ebe504f1387.tar.gz
rust-ef29f7ff3659712bc045e47778c45ebe504f1387.zip
syntax: Fix semicolon printing. Closes #3036
-rw-r--r--src/libsyntax/parse/token.rs2
-rw-r--r--src/test/compile-fail/issue-3036.rs6
2 files changed, 7 insertions, 1 deletions
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs
index 51d5d52ebe8..b6672936be6 100644
--- a/src/libsyntax/parse/token.rs
+++ b/src/libsyntax/parse/token.rs
@@ -136,7 +136,7 @@ fn to_str(in: interner<@~str>, t: token) -> ~str {
       DOT { ~"." }
       ELLIPSIS { ~"..." }
       COMMA { ~"," }
-      SEMI { ~"" }
+      SEMI { ~";" }
       COLON { ~":" }
       MOD_SEP { ~"::" }
       RARROW { ~"->" }
diff --git a/src/test/compile-fail/issue-3036.rs b/src/test/compile-fail/issue-3036.rs
new file mode 100644
index 00000000000..337d38f26ac
--- /dev/null
+++ b/src/test/compile-fail/issue-3036.rs
@@ -0,0 +1,6 @@
+// Testing that semicolon tokens are printed correctly in errors
+
+fn main()
+{
+    let x = 3
+} //~ ERROR: expected `;` but found `}`