summaryrefslogtreecommitdiffstats
path: root/src/test/ui/lexer/lex-bad-char-literals-7.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/lexer/lex-bad-char-literals-7.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/ui/lexer/lex-bad-char-literals-7.rs b/src/test/ui/lexer/lex-bad-char-literals-7.rs
new file mode 100644
index 000000000..c675df2f3
--- /dev/null
+++ b/src/test/ui/lexer/lex-bad-char-literals-7.rs
@@ -0,0 +1,13 @@
+fn main() {
+ let _: char = '';
+ //~^ ERROR: empty character literal
+ let _: char = '\u{}';
+ //~^ ERROR: empty unicode escape
+
+ // Next two are OK, but may befool error recovery
+ let _ = '/';
+ let _ = b'/';
+
+ let _ = ' hello // here's a comment
+ //~^ ERROR: unterminated character literal
+}