blob: 95738b2bec5a43001f676bb5445f0cde69b6c23c [file] [edit]
#![allow(dead_code)]
#![forbid(non_camel_case_types)]
// Some scripts (e.g., hiragana) don't have a concept of
// upper/lowercase
// 1. non_camel_case_types
// Can start with non-lowercase letter
struct Θχ;
struct a;
struct χa;
//~^ ERROR type `χa` should have an upper camel case name
// If there's already leading or trailing underscores, they get trimmed before checking.
// This is fine:
struct _b;
// This is not:
struct __χa;
//~^ ERROR type `__χa` should have an upper camel case name
// Besides this, we cannot have two continuous underscores in the middle.
struct __否;
//~^ ERROR type `对__否` should have an upper camel case name
struct __χ;
//~^ ERROR type `ヒ__χ` should have an upper camel case name
// also cannot have lowercase letter next to an underscore.
// so this triggers the lint:
struct Hello_你好;
//~^ ERROR type `Hello_你好` should have an upper camel case name
struct Hello_World;
//~^ ERROR type `Hello_World` should have an upper camel case name
struct _ӟ;
//~^ ERROR type `你_ӟ` should have an upper camel case name
struct ΦΙΛΟΣ_Σ;
//~^ ERROR type `ΦΙΛΟΣ_Σ` should have an upper camel case name
struct Σ_ΦΙΛΟΣ;
//~^ ERROR type `Σ_ΦΙΛΟΣ` should have an upper camel case name
// these are ok:
struct _好;
struct ძალა_ერთობაშია;
struct Σ;
fn main() {}