]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lint/lint-non-camel-case-types.rs
Auto merge of #106349 - LeSeulArtichaut:dyn-star-tracking-issue, r=jackh726
[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 an upper camel case name
6
7 struct foo { //~ ERROR type `foo` should have an upper camel case name
8     bar: isize,
9 }
10
11 enum foo2 { //~ ERROR type `foo2` should have an upper camel case name
12     Bar
13 }
14
15 struct foo3 { //~ ERROR type `foo3` should have an upper camel case name
16     bar: isize
17 }
18
19 type foo4 = isize; //~ ERROR type `foo4` should have an upper camel case name
20
21 enum Foo5 {
22     bar //~ ERROR variant `bar` should have an upper camel case name
23 }
24
25 trait foo6 { //~ ERROR trait `foo6` should have an upper camel case name
26     type foo7; //~ ERROR associated type `foo7` should have an upper camel case name
27     fn dummy(&self) { }
28 }
29
30 fn f<ty>(_: ty) {} //~ ERROR type parameter `ty` should have an upper camel case name
31
32 #[repr(C)]
33 struct foo7 {
34     bar: isize,
35 }
36
37 fn main() { }