mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-02 17:40:13 +00:00
34 lines
1.2 KiB
Rust
34 lines
1.2 KiB
Rust
|
#![feature(plugin)]
|
|||
|
#![plugin(clippy)]
|
|||
|
|
|||
|
#![deny(clippy)]
|
|||
|
#![allow(dead_code)]
|
|||
|
|
|||
|
fn good(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool) {}
|
|||
|
|
|||
|
fn bad(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool, _eight: ()) {
|
|||
|
//~^ ERROR: this function has to many arguments (8/7)
|
|||
|
}
|
|||
|
|
|||
|
trait Foo {
|
|||
|
fn good(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool);
|
|||
|
fn bad(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool, _eight: ());
|
|||
|
//~^ ERROR: this function has to many arguments (8/7)
|
|||
|
}
|
|||
|
|
|||
|
struct Bar;
|
|||
|
|
|||
|
impl Bar {
|
|||
|
fn good_method(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool) {}
|
|||
|
fn bad_method(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool, _eight: ()) {}
|
|||
|
//~^ ERROR: this function has to many arguments (8/7)
|
|||
|
}
|
|||
|
|
|||
|
// ok, we don’t want to warn implementations
|
|||
|
impl Foo for Bar {
|
|||
|
fn good(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool) {}
|
|||
|
fn bad(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool, _eight: ()) {}
|
|||
|
}
|
|||
|
|
|||
|
fn main() {}
|