]> git.lizzy.rs Git - rust.git/blob - tests/ui/unicode.rs
Auto merge of #3603 - xfix:random-state-lint, r=phansch
[rust.git] / tests / ui / unicode.rs
1 // Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution.
3 //
4 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
5 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
7 // option. This file may not be copied, modified, or distributed
8 // except according to those terms.
9
10 #[warn(clippy::zero_width_space)]
11 fn zero() {
12     print!("Here >​< is a ZWS, and ​another");
13     print!("This\u{200B}is\u{200B}fine");
14 }
15
16 #[warn(clippy::unicode_not_nfc)]
17 fn canon() {
18     print!("̀àh?");
19     print!("a\u{0300}h?"); // also okay
20 }
21
22 #[warn(clippy::non_ascii_literal)]
23 fn uni() {
24     print!("Üben!");
25     print!("\u{DC}ben!"); // this is okay
26 }
27
28 fn main() {
29     zero();
30     uni();
31     canon();
32 }