2014-07-18 07:45:17 -05:00
|
|
|
#![deny(non_snake_case)]
|
2014-05-25 17:23:41 -05:00
|
|
|
#![allow(dead_code)]
|
|
|
|
|
|
|
|
struct Foo;
|
|
|
|
|
|
|
|
impl Foo {
|
|
|
|
fn Foo_Method() {}
|
2019-01-04 09:19:52 -06:00
|
|
|
//~^ ERROR method `Foo_Method` should have a snake case name
|
2014-05-25 17:23:41 -05:00
|
|
|
|
|
|
|
// Don't allow two underscores in a row
|
|
|
|
fn foo__method(&self) {}
|
2019-01-04 09:19:52 -06:00
|
|
|
//~^ ERROR method `foo__method` should have a snake case name
|
2014-05-25 17:23:41 -05:00
|
|
|
|
|
|
|
pub fn xyZ(&mut self) {}
|
2019-01-04 09:19:52 -06:00
|
|
|
//~^ ERROR method `xyZ` should have a snake case name
|
2014-09-12 20:59:15 -05:00
|
|
|
|
|
|
|
fn render_HTML() {}
|
2019-01-04 09:19:52 -06:00
|
|
|
//~^ ERROR method `render_HTML` should have a snake case name
|
2014-05-25 17:23:41 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
trait X {
|
|
|
|
fn ABC();
|
2019-01-04 09:19:52 -06:00
|
|
|
//~^ ERROR trait method `ABC` should have a snake case name
|
2014-05-25 17:23:41 -05:00
|
|
|
|
|
|
|
fn a_b_C(&self) {}
|
2019-01-04 09:19:52 -06:00
|
|
|
//~^ ERROR trait method `a_b_C` should have a snake case name
|
2014-05-25 17:23:41 -05:00
|
|
|
|
|
|
|
fn something__else(&mut self);
|
2019-01-04 09:19:52 -06:00
|
|
|
//~^ ERROR trait method `something__else` should have a snake case name
|
2014-05-25 17:23:41 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
impl X for Foo {
|
|
|
|
// These errors should be caught at the trait definition not the impl
|
|
|
|
fn ABC() {}
|
|
|
|
fn something__else(&mut self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn Cookie() {}
|
2019-01-04 09:19:52 -06:00
|
|
|
//~^ ERROR function `Cookie` should have a snake case name
|
2014-05-25 17:23:41 -05:00
|
|
|
|
|
|
|
pub fn bi_S_Cuit() {}
|
2019-01-04 09:19:52 -06:00
|
|
|
//~^ ERROR function `bi_S_Cuit` should have a snake case name
|
2014-05-25 17:23:41 -05:00
|
|
|
|
|
|
|
fn main() { }
|