mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-18 09:03:18 +00:00
33 lines
1.2 KiB
Rust
33 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 too 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 too 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 too 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() {}
|