mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 07:00:55 +00:00
Not trigger duplicated_attributes on duplicate reasons
This commit is contained in:
parent
a53614a910
commit
7097830a9b
2 changed files with 5 additions and 1 deletions
|
@ -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.
|
||||
|
|
|
@ -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() {}
|
||||
|
|
Loading…
Reference in a new issue