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 {
|
2019-01-04 15:19:52 +00:00
|
|
|
X: usize //~ ERROR structure field `X` should have a snake case name
|
2014-02-16 06:03:07 +00:00
|
|
|
}
|
|
|
|
|
2019-01-04 15:19:52 +00:00
|
|
|
fn test(Xx: usize) { //~ ERROR variable `Xx` should have a snake case name
|
2014-02-15 21:15:19 +00:00
|
|
|
println!("{}", Xx);
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2019-01-04 15:19:52 +00:00
|
|
|
let Test: usize = 0; //~ ERROR variable `Test` should have a snake case name
|
2014-02-15 21:15:19 +00:00
|
|
|
println!("{}", Test);
|
|
|
|
|
2015-02-17 19:05:44 +00:00
|
|
|
match foo::Foo::Foo {
|
|
|
|
Foo => {}
|
2022-12-17 19:11:25 +00:00
|
|
|
//~^ ERROR variable `Foo` should have a snake case name
|
2022-11-08 15:24:06 +00:00
|
|
|
//~^^ ERROR `Foo` is named the same as one of the variants of the type `foo::Foo`
|
2022-12-17 19:11:25 +00:00
|
|
|
//~^^^ WARN unused variable: `Foo`
|
2014-02-15 21:15:19 +00:00
|
|
|
}
|
|
|
|
|
2020-01-20 16:57:08 +00:00
|
|
|
let Foo = foo::Foo::Foo;
|
|
|
|
//~^ ERROR variable `Foo` should have a snake case name
|
2022-11-08 15:24:06 +00:00
|
|
|
//~^^ ERROR `Foo` is named the same as one of the variants of the type `foo::Foo`
|
2020-01-20 16:57:08 +00:00
|
|
|
//~^^^ WARN unused variable: `Foo`
|
|
|
|
|
|
|
|
fn in_param(Foo: foo::Foo) {}
|
|
|
|
//~^ ERROR variable `Foo` should have a snake case name
|
2022-11-08 15:24:06 +00:00
|
|
|
//~^^ ERROR `Foo` is named the same as one of the variants of the type `foo::Foo`
|
2020-01-20 16:57:08 +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
|
|
|
}
|