about summary refs log tree commit diff
diff options
context:
space:
mode:
-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 `}`