]> git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui/unicode.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / unicode.rs
1 // run-rustfix
2 #[warn(clippy::invisible_characters)]
3 fn zero() {
4 print!("Here >​< is a ZWS, and ​another");
5 print!("This\u{200B}is\u{200B}fine");
6 print!("Here >­< is a SHY, and ­another");
7 print!("This\u{ad}is\u{ad}fine");
8 print!("Here >⁠< is a WJ, and ⁠another");
9 print!("This\u{2060}is\u{2060}fine");
10 }
11
12 #[warn(clippy::unicode_not_nfc)]
13 fn canon() {
14 print!("̀àh?");
15 print!("a\u{0300}h?"); // also ok
16 }
17
18 #[warn(clippy::non_ascii_literal)]
19 fn uni() {
20 print!("Üben!");
21 print!("\u{DC}ben!"); // this is ok
22 }
23
24 // issue 8013
25 #[warn(clippy::non_ascii_literal)]
26 fn single_quote() {
27 const _EMPTY_BLOCK: char = '▱';
28 const _FULL_BLOCK: char = '▰';
29 }
30
31 fn main() {
32 zero();
33 uni();
34 canon();
35 single_quote();
36 }