]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/issue-23620-invalid-escapes.rs
Rollup merge of #67005 - andrewbanchich:master, r=joshtriplett
[rust.git] / src / test / ui / parser / issue-23620-invalid-escapes.rs
1 // compile-flags: -Z continue-parse-after-error
2
3 fn main() {
4     let _ = b"\u{a66e}";
5     //~^ ERROR unicode escape sequences cannot be used as a byte or in a byte string
6
7     let _ = b'\u{a66e}';
8     //~^ ERROR unicode escape sequences cannot be used as a byte or in a byte string
9
10     let _ = b'\u';
11     //~^ ERROR incorrect unicode escape sequence
12
13     let _ = b'\x5';
14     //~^ ERROR numeric character escape is too short
15
16     let _ = b'\xxy';
17     //~^ ERROR invalid character in numeric character escape: x
18
19     let _ = '\x5';
20     //~^ ERROR numeric character escape is too short
21
22     let _ = '\xxy';
23     //~^ ERROR invalid character in numeric character escape: x
24
25     let _ = b"\u{a4a4} \xf \u";
26     //~^ ERROR unicode escape sequences cannot be used as a byte or in a byte string
27     //~^^ ERROR invalid character in numeric character escape:
28     //~^^^ ERROR incorrect unicode escape sequence
29
30     let _ = "\xf \u";
31     //~^ ERROR invalid character in numeric character escape:
32     //~^^ ERROR incorrect unicode escape sequence
33
34     let _ = "\u8f";
35     //~^ ERROR incorrect unicode escape sequence
36 }