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