Skip to main content

DUPLICATE_PARAMETER_NAMES

Static DUPLICATE_PARAMETER_NAMES 

Source
pub static DUPLICATE_PARAMETER_NAMES: &Lint
Expand description

The duplicate_parameter_names lint detects duplicate parameter names in functions without bodies.

§Example

ⓘ
 #![deny(duplicate_parameter_names)]
 pub trait Foo {
     fn foo(x: usize, x: usize);
 }
 fn main() {}

{{produces}}

§Explanation

Duplicate parameter names are allowed in body-less functions, in function pointers, and in parenthesised generic args, but this is confusing and inconsistent behaviour, and is discouraged.