]> git.proxmox.com Git - rustc.git/blame - src/test/ui/lint/lint-non-camel-case-types.rs
New upstream version 1.34.2+dfsg1
[rustc.git] / src / test / ui / lint / lint-non-camel-case-types.rs
CommitLineData
1a4d82fc
JJ
1#![forbid(non_camel_case_types)]
2#![allow(dead_code)]
223e47cc 3
c34b1796 4struct ONE_TWO_THREE;
9fa01778 5//~^ ERROR type `ONE_TWO_THREE` should have an upper camel case name
c34b1796 6
9fa01778 7struct foo { //~ ERROR type `foo` should have an upper camel case name
1a4d82fc 8 bar: isize,
223e47cc
LB
9}
10
9fa01778 11enum foo2 { //~ ERROR type `foo2` should have an upper camel case name
223e47cc
LB
12 Bar
13}
14
9fa01778 15struct foo3 { //~ ERROR type `foo3` should have an upper camel case name
1a4d82fc 16 bar: isize
223e47cc
LB
17}
18
9fa01778 19type foo4 = isize; //~ ERROR type `foo4` should have an upper camel case name
223e47cc
LB
20
21enum Foo5 {
9fa01778 22 bar //~ ERROR variant `bar` should have an upper camel case name
223e47cc
LB
23}
24
9fa01778 25trait foo6 { //~ ERROR trait `foo6` should have an upper camel case name
85aaf69f 26 fn dummy(&self) { }
223e47cc
LB
27}
28
9fa01778 29fn f<ty>(_: ty) {} //~ ERROR type parameter `ty` should have an upper camel case name
1a4d82fc
JJ
30
31#[repr(C)]
32struct foo7 {
33 bar: isize,
34}
35
223e47cc 36fn main() { }