Static rustc_lint_defs::builtin::DUPLICATE_MACRO_ATTRIBUTES[−][src]

pub static DUPLICATE_MACRO_ATTRIBUTES: &Lint
Expand description

The duplicate_macro_attributes lint detects when a #[test]-like built-in macro attribute is duplicated on an item. This lint may trigger on bench, cfg_eval, test and test_case.

Example

ⓘ
#[test]
#[test]
fn foo() {}

{{produces}}

Explanation

A duplicated attribute may erroneously originate from a copy-paste and the effect of it being duplicated may not be obvious or desireable.

For instance, doubling the #[test] attributes registers the test to be run twice with no change to its environment.