rustc: Add non_camel_case_types lint check

This commit is contained in:
Brian Anderson 2012-07-31 18:58:03 -07:00
parent 2a3084b527
commit a841789a41
6 changed files with 78 additions and 0 deletions

View file

@ -0,0 +1,11 @@
#[forbid(non_camel_case_types)]
class foo { //~ ERROR type, variant, or trait must be camel case
let bar: int;
new() {
self.bar = 0;
}
}
fn main() {
}

View file

@ -0,0 +1,7 @@
#[forbid(non_camel_case_types)]
enum foo { //~ ERROR type, variant, or trait must be camel case
Bar
}
fn main() {
}

View file

@ -0,0 +1,7 @@
#[forbid(non_camel_case_types)]
struct foo { //~ ERROR type, variant, or trait must be camel case
bar: int;
}
fn main() {
}

View file

@ -0,0 +1,5 @@
#[forbid(non_camel_case_types)]
type foo = int; //~ ERROR type, variant, or trait must be camel case
fn main() {
}

View file

@ -0,0 +1,7 @@
#[forbid(non_camel_case_types)]
enum Foo {
bar //~ ERROR type, variant, or trait must be camel case
}
fn main() {
}