diff options
| author | Alexey Semenyuk <alexsemenyuk88@gmail.com> | 2024-09-12 11:49:16 +0500 |
|---|---|---|
| committer | Alexey Semenyuk <alexsemenyuk88@gmail.com> | 2024-09-12 11:49:16 +0500 |
| commit | 7097830a9b6c2d9c56d0b8cea7b0612dc8a53b50 (patch) | |
| tree | b88be20b8146c8d3053b8a9ea07c3ff8510949cf | |
| parent | a53614a910310130ac75ce15a73a8c4dbd795826 (diff) | |
| download | rust-7097830a9b6c2d9c56d0b8cea7b0612dc8a53b50.tar.gz rust-7097830a9b6c2d9c56d0b8cea7b0612dc8a53b50.zip | |
Not trigger duplicated_attributes on duplicate reasons
| -rw-r--r-- | clippy_lints/src/attrs/duplicated_attributes.rs | 2 | ||||
| -rw-r--r-- | tests/ui/duplicated_attributes.rs | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/clippy_lints/src/attrs/duplicated_attributes.rs b/clippy_lints/src/attrs/duplicated_attributes.rs index 40a1c4e2884..199e07565b0 100644 --- a/clippy_lints/src/attrs/duplicated_attributes.rs +++ b/clippy_lints/src/attrs/duplicated_attributes.rs @@ -36,7 +36,7 @@ fn check_duplicated_attr( } let Some(ident) = attr.ident() else { return }; let name = ident.name; - if name == sym::doc || name == sym::cfg_attr || name == sym::rustc_on_unimplemented { + if name == sym::doc || name == sym::cfg_attr || name == sym::rustc_on_unimplemented || name == sym::reason { // FIXME: Would be nice to handle `cfg_attr` as well. Only problem is to check that cfg // conditions are the same. // `#[rustc_on_unimplemented]` contains duplicated subattributes, that's expected. diff --git a/tests/ui/duplicated_attributes.rs b/tests/ui/duplicated_attributes.rs index 97cf4a69682..874f5d22075 100644 --- a/tests/ui/duplicated_attributes.rs +++ b/tests/ui/duplicated_attributes.rs @@ -27,4 +27,8 @@ trait Abc {} #[proc_macro_attr::duplicated_attr()] // Should not warn! fn babar() {} +#[allow(missing_docs, reason = "library for internal use only")] +#[allow(exported_private_dependencies, reason = "library for internal use only")] +fn duplicate_reason() {} + fn main() {} |
