Skip to content

Commit e039e72

Browse files
committed
Auto merge of rust-lang#13386 - alex-semenyuk:no_lint_on_duplicate_reason, r=xFrednet
Not trigger `duplicated_attributes` on duplicate reasons As at rust-lang#13355 we shoudn't trigger `duplicated_attributes` on duplicate reasons attr changelog: [`duplicated_attributes`]: not trigger `duplicated_attributes` on duplicate reasons
2 parents 131681b + 7097830 commit e039e72

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

clippy_lints/src/attrs/duplicated_attributes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ 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 {
39+
if name == sym::doc || name == sym::cfg_attr || name == sym::rustc_on_unimplemented || name == sym::reason {
4040
// FIXME: Would be nice to handle `cfg_attr` as well. Only problem is to check that cfg
4141
// conditions are the same.
4242
// `#[rustc_on_unimplemented]` contains duplicated subattributes, that's expected.

tests/ui/duplicated_attributes.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,8 @@ trait Abc {}
2727
#[proc_macro_attr::duplicated_attr()] // Should not warn!
2828
fn babar() {}
2929

30+
#[allow(missing_docs, reason = "library for internal use only")]
31+
#[allow(exported_private_dependencies, reason = "library for internal use only")]
32+
fn duplicate_reason() {}
33+
3034
fn main() {}

0 commit comments

Comments
 (0)