rustc: Add non_camel_case_types lint check
This commit is contained in:
parent
2a3084b527
commit
a841789a41
6 changed files with 78 additions and 0 deletions
11
src/test/compile-fail/lint-non-camel-case-class.rs
Normal file
11
src/test/compile-fail/lint-non-camel-case-class.rs
Normal 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() {
|
||||
}
|
||||
7
src/test/compile-fail/lint-non-camel-case-enum.rs
Normal file
7
src/test/compile-fail/lint-non-camel-case-enum.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#[forbid(non_camel_case_types)]
|
||||
enum foo { //~ ERROR type, variant, or trait must be camel case
|
||||
Bar
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
7
src/test/compile-fail/lint-non-camel-case-struct.rs
Normal file
7
src/test/compile-fail/lint-non-camel-case-struct.rs
Normal 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() {
|
||||
}
|
||||
5
src/test/compile-fail/lint-non-camel-case-type.rs
Normal file
5
src/test/compile-fail/lint-non-camel-case-type.rs
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#[forbid(non_camel_case_types)]
|
||||
type foo = int; //~ ERROR type, variant, or trait must be camel case
|
||||
|
||||
fn main() {
|
||||
}
|
||||
7
src/test/compile-fail/lint-non-camel-case-variant.rs
Normal file
7
src/test/compile-fail/lint-non-camel-case-variant.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#[forbid(non_camel_case_types)]
|
||||
enum Foo {
|
||||
bar //~ ERROR type, variant, or trait must be camel case
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue