Skip to content

Commit 4185b84

Browse files
committed
Make clippy account for rustc_cfg_placeholder
Avoid "duplicated attribute" lints firing on the cfg placeholder.
1 parent b8e9477 commit 4185b84

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/tools/clippy/clippy_lints/src/attrs/duplicated_attributes.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ fn check_duplicated_attr(
3636
}
3737
let Some(ident) = attr.ident() else { return };
3838
let name = ident.name;
39-
if name == sym::doc || name == sym::cfg_attr || name == sym::rustc_on_unimplemented || name == sym::reason {
39+
if name == sym::doc
40+
|| name == sym::cfg_attr
41+
|| name == sym::rustc_on_unimplemented
42+
|| name == sym::reason
43+
|| name == sym::rustc_cfg_placeholder
44+
{
4045
// FIXME: Would be nice to handle `cfg_attr` as well. Only problem is to check that cfg
4146
// conditions are the same.
4247
// `#[rustc_on_unimplemented]` contains duplicated subattributes, that's expected.

0 commit comments

Comments
 (0)