rust/src/test/ui/parser/issue-23620-invalid-escapes.stderr
Aleksey Kladov bfa5f27847 introduce unescape module
Currently, we deal with escape sequences twice: once when we lex a
string, and a second time when we unescape literals. This PR aims to
remove this duplication, by introducing a new `unescape` mode as a
single source of truth for character escaping rules
2019-05-02 15:31:57 +03:00

89 lines
2.5 KiB
Plaintext

error: unicode escape sequences cannot be used as a byte or in a byte string
--> $DIR/issue-23620-invalid-escapes.rs:4:15
|
LL | let _ = b"\u{a66e}";
| ^^^^^^^^
error: unicode escape sequences cannot be used as a byte or in a byte string
--> $DIR/issue-23620-invalid-escapes.rs:7:15
|
LL | let _ = b'\u{a66e}';
| ^^^^^^^^
error: incorrect unicode escape sequence
--> $DIR/issue-23620-invalid-escapes.rs:10:15
|
LL | let _ = b'\u';
| ^^ incorrect unicode escape sequence
|
= help: format of unicode escape sequences is `\u{...}`
error: numeric character escape is too short
--> $DIR/issue-23620-invalid-escapes.rs:13:15
|
LL | let _ = b'\x5';
| ^^^
error: invalid character in numeric character escape: x
--> $DIR/issue-23620-invalid-escapes.rs:16:17
|
LL | let _ = b'\xxy';
| ^
error: numeric character escape is too short
--> $DIR/issue-23620-invalid-escapes.rs:19:14
|
LL | let _ = '\x5';
| ^^^
error: invalid character in numeric character escape: x
--> $DIR/issue-23620-invalid-escapes.rs:22:16
|
LL | let _ = '\xxy';
| ^
error: unicode escape sequences cannot be used as a byte or in a byte string
--> $DIR/issue-23620-invalid-escapes.rs:25:15
|
LL | let _ = b"\u{a4a4} \xf \u";
| ^^^^^^^^
error: invalid character in numeric character escape:
--> $DIR/issue-23620-invalid-escapes.rs:25:27
|
LL | let _ = b"\u{a4a4} \xf \u";
| ^
error: incorrect unicode escape sequence
--> $DIR/issue-23620-invalid-escapes.rs:25:28
|
LL | let _ = b"\u{a4a4} \xf \u";
| ^^ incorrect unicode escape sequence
|
= help: format of unicode escape sequences is `\u{...}`
error: invalid character in numeric character escape:
--> $DIR/issue-23620-invalid-escapes.rs:30:17
|
LL | let _ = "\xf \u";
| ^
error: incorrect unicode escape sequence
--> $DIR/issue-23620-invalid-escapes.rs:30:18
|
LL | let _ = "\xf \u";
| ^^ incorrect unicode escape sequence
|
= help: format of unicode escape sequences is `\u{...}`
error: incorrect unicode escape sequence
--> $DIR/issue-23620-invalid-escapes.rs:34:14
|
LL | let _ = "\u8f";
| ^^--
| |
| help: format of unicode escape sequences uses braces: `\u{8f}`
error: aborting due to 13 previous errors