]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lint/lint-nonstandard-style-unicode-1.rs
Merge commit 'c1664c50b27a51f7a78c93ba65558e7c33eabee6' into clippyup
[rust.git] / src / test / ui / lint / lint-nonstandard-style-unicode-1.rs
1 #![allow(dead_code)]
2
3 #![forbid(non_camel_case_types)]
4 #![feature(non_ascii_idents)]
5
6 // Some scripts (e.g., hiragana) don't have a concept of
7 // upper/lowercase
8
9 // 1. non_camel_case_types
10
11 // Can start with non-lowercase letter
12 struct Θχ;
13 struct ヒa;
14
15 struct χa;
16 //~^ ERROR type `χa` should have an upper camel case name
17
18 // If there's already leading or trailing underscores, they get trimmed before checking.
19 // This is fine:
20 struct _ヒb;
21
22 // This is not:
23 struct __χa;
24 //~^ ERROR type `__χa` should have an upper camel case name
25
26 // Besides this, we cannot have two continuous underscores in the middle.
27
28 struct 对__否;
29 //~^ ERROR type `对__否` should have an upper camel case name
30
31 struct ヒ__χ;
32 //~^ ERROR type `ヒ__χ` should have an upper camel case name
33
34 // also cannot have lowercase letter next to a underscore.
35 // so this triggers the lint:
36
37 struct Hello_你好;
38 //~^ ERROR type `Hello_你好` should have an upper camel case name
39
40 struct Hello_World;
41 //~^ ERROR type `Hello_World` should have an upper camel case name
42
43 struct 你_ӟ;
44 //~^ ERROR type `你_ӟ` should have an upper camel case name
45
46 // and this is ok:
47
48 struct 你_好;
49
50 fn main() {}