Skip to content

Commit ef29f7f

Browse files
committed
syntax: Fix semicolon printing. Closes #3036
1 parent 416584d commit ef29f7f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/libsyntax/parse/token.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ fn to_str(in: interner<@~str>, t: token) -> ~str {
136136
DOT { ~"." }
137137
ELLIPSIS { ~"..." }
138138
COMMA { ~"," }
139-
SEMI { ~"" }
139+
SEMI { ~";" }
140140
COLON { ~":" }
141141
MOD_SEP { ~"::" }
142142
RARROW { ~"->" }

src/test/compile-fail/issue-3036.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Testing that semicolon tokens are printed correctly in errors
2+
3+
fn main()
4+
{
5+
let x = 3
6+
} //~ ERROR: expected `;` but found `}`

0 commit comments

Comments
 (0)