summaryrefslogtreecommitdiffstats
path: root/tests/ui/parser/ascii-only-character-escape.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/parser/ascii-only-character-escape.rs')
-rw-r--r--tests/ui/parser/ascii-only-character-escape.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/ui/parser/ascii-only-character-escape.rs b/tests/ui/parser/ascii-only-character-escape.rs
new file mode 100644
index 000000000..725c8ad23
--- /dev/null
+++ b/tests/ui/parser/ascii-only-character-escape.rs
@@ -0,0 +1,6 @@
+fn main() {
+ let x = "\x80"; //~ ERROR out of range hex escape
+ let y = "\xff"; //~ ERROR out of range hex escape
+ let z = "\xe2"; //~ ERROR out of range hex escape
+ let a = b"\x00e2"; // ok because byte literal
+}