]> git.lizzy.rs Git - rust.git/blob - tests/ui/parser/unicode-control-codepoints.rs
Rollup merge of #106648 - Nilstrieb:poly-cleanup, r=compiler-errors
[rust.git] / tests / ui / parser / unicode-control-codepoints.rs
1 fn main() {
2     // if access_level != "us‫e‪r" { // Check if admin
3     //~^ ERROR unicode codepoint changing visible direction of text present in comment
4     println!("us\u{202B}e\u{202A}r");
5     println!("{:?}", r#"us\u{202B}e\u{202A}r"#);
6     println!("{:?}", b"us\u{202B}e\u{202A}r");
7     //~^ ERROR unicode escape in byte string
8     //~| ERROR unicode escape in byte string
9     println!("{:?}", br##"us\u{202B}e\u{202A}r"##);
10
11     println!("{:?}", "/*‮ } ⁦if isAdmin⁩ ⁦ begin admins only ");
12     //~^ ERROR unicode codepoint changing visible direction of text present in literal
13
14     println!("{:?}", r##"/*‮ } ⁦if isAdmin⁩ ⁦ begin admins only "##);
15     //~^ ERROR unicode codepoint changing visible direction of text present in literal
16     println!("{:?}", b"/*‮ } ⁦if isAdmin⁩ ⁦ begin admins only ");
17     //~^ ERROR non-ASCII character in byte string literal
18     //~| ERROR non-ASCII character in byte string literal
19     //~| ERROR non-ASCII character in byte string literal
20     //~| ERROR non-ASCII character in byte string literal
21     println!("{:?}", br##"/*‮ } ⁦if isAdmin⁩ ⁦ begin admins only "##);
22     //~^ ERROR non-ASCII character in raw byte string literal
23     //~| ERROR non-ASCII character in raw byte string literal
24     //~| ERROR non-ASCII character in raw byte string literal
25     //~| ERROR non-ASCII character in raw byte string literal
26     println!("{:?}", '‮');
27     //~^ ERROR unicode codepoint changing visible direction of text present in literal
28 }
29
30 //"/*‮ } ⁦if isAdmin⁩ ⁦ begin admins only */"
31 //~^ ERROR unicode codepoint changing visible direction of text present in comment
32
33 /**  '‮'); */fn foo() {}
34 //~^ ERROR unicode codepoint changing visible direction of text present in doc comment
35
36 /**
37  *
38  *  '‮'); */fn bar() {}
39 //~^^^ ERROR unicode codepoint changing visible direction of text present in doc comment