]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lint/lint-non-camel-case-types.rs
Rollup merge of #57232 - Zoxc:par-collector-misc, r=michaelwoerister
[rust.git] / src / test / ui / lint / lint-non-camel-case-types.rs
1 #![forbid(non_camel_case_types)]
2 #![allow(dead_code)]
3
4 struct ONE_TWO_THREE;
5 //~^ ERROR type `ONE_TWO_THREE` should have a camel case name
6
7 struct foo { //~ ERROR type `foo` should have a camel case name
8     bar: isize,
9 }
10
11 enum foo2 { //~ ERROR type `foo2` should have a camel case name
12     Bar
13 }
14
15 struct foo3 { //~ ERROR type `foo3` should have a camel case name
16     bar: isize
17 }
18
19 type foo4 = isize; //~ ERROR type `foo4` should have a camel case name
20
21 enum Foo5 {
22     bar //~ ERROR variant `bar` should have a camel case name
23 }
24
25 trait foo6 { //~ ERROR trait `foo6` should have a camel case name
26     fn dummy(&self) { }
27 }
28
29 fn f<ty>(_: ty) {} //~ ERROR type parameter `ty` should have a camel case name
30
31 #[repr(C)]
32 struct foo7 {
33     bar: isize,
34 }
35
36 struct X86_64;
37
38 struct X86__64; //~ ERROR type `X86__64` should have a camel case name
39
40 struct Abc_123; //~ ERROR type `Abc_123` should have a camel case name
41
42 struct A1_b2_c3; //~ ERROR type `A1_b2_c3` should have a camel case name
43
44 fn main() { }