2017-07-27 04:51:09 +00:00
|
|
|
#![warn(unused)]
|
2014-06-06 13:51:42 +00:00
|
|
|
#![allow(dead_code)]
|
2014-07-18 12:45:17 +00:00
|
|
|
#![deny(non_snake_case)]
|
2014-02-15 21:15:19 +00:00
|
|
|
|
2015-02-17 19:05:44 +00:00
|
|
|
mod foo {
|
|
|
|
pub enum Foo { Foo }
|
|
|
|
}
|
|
|
|
|
2014-02-16 06:03:07 +00:00
|
|
|
struct Something {
|
2015-01-08 11:02:42 +00:00
|
|
|
X: usize //~ ERROR structure field `X` should have a snake case name such as `x`
|
2014-02-16 06:03:07 +00:00
|
|
|
}
|
|
|
|
|
2015-01-08 11:02:42 +00:00
|
|
|
fn test(Xx: usize) { //~ ERROR variable `Xx` should have a snake case name such as `xx`
|
2014-02-15 21:15:19 +00:00
|
|
|
println!("{}", Xx);
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2015-01-08 11:02:42 +00:00
|
|
|
let Test: usize = 0; //~ ERROR variable `Test` should have a snake case name such as `test`
|
2014-02-15 21:15:19 +00:00
|
|
|
println!("{}", Test);
|
|
|
|
|
2015-02-17 19:05:44 +00:00
|
|
|
match foo::Foo::Foo {
|
|
|
|
Foo => {}
|
|
|
|
//~^ ERROR variable `Foo` should have a snake case name such as `foo`
|
|
|
|
//~^^ WARN `Foo` is named the same as one of the variants of the type `foo::Foo`
|
2015-02-17 23:24:34 +00:00
|
|
|
//~^^^ WARN unused variable: `Foo`
|
2014-02-15 21:15:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
test(1);
|
2014-02-16 06:03:07 +00:00
|
|
|
|
|
|
|
let _ = Something { X: 0 };
|
2014-02-15 21:15:19 +00:00
|
|
|
}
|