Skip to content

Commit

Permalink
Ignore buggy clippy::duplicated_attributes lint
Browse files Browse the repository at this point in the history
rust-lang/rust-clippy#12537
rust-lang/rust-clippy#12538

```
error: duplicated attribute
     --> src\imp\mod.rs:168:21
      |
  168 |             any(not(portable_atomic_no_asm), portable_atomic_unstable_asm),
      |                     ^^^^^^^^^^^^^^^^^^^^^^
      |
  note: first defined here
     --> src\imp\mod.rs:164:21
      |
  164 |             any(not(portable_atomic_no_asm), portable_atomic_unstable_asm),
      |                     ^^^^^^^^^^^^^^^^^^^^^^
  help: remove this attribute
     --> src\imp\mod.rs:168:21
      |
  168 |             any(not(portable_atomic_no_asm), portable_atomic_unstable_asm),
      |                     ^^^^^^^^^^^^^^^^^^^^^^
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes
      = note: `-D clippy::duplicated-attributes` implied by `-D warnings`
      = help: to override `-D warnings` add `#[allow(clippy::duplicated_attributes)]`

  error: duplicated attribute
     --> src\imp\mod.rs:168:46
      |
  168 |             any(not(portable_atomic_no_asm), portable_atomic_unstable_asm),
      |                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      |
  note: first defined here
     --> src\imp\mod.rs:164:46
      |
  164 |             any(not(portable_atomic_no_asm), portable_atomic_unstable_asm),
      |                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  help: remove this attribute
     --> src\imp\mod.rs:168:46
      |
  168 |             any(not(portable_atomic_no_asm), portable_atomic_unstable_asm),
      |                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes

  error: duplicated attribute
     --> src\imp\mod.rs:179:36
      |
  179 |         all(target_arch = "s390x", portable_atomic_unstable_asm_experimental_arch),
      |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      |
  note: first defined here
     --> src\imp\mod.rs:173:13
      |
  173 |             portable_atomic_unstable_asm_experimental_arch,
      |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  help: remove this attribute
     --> src\imp\mod.rs:179:36
      |
  179 |         all(target_arch = "s390x", portable_atomic_unstable_asm_experimental_arch),
      |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes

  error: duplicated attribute
     --> src\imp\mod.rs:205:5
      |
  205 |     target_arch = "avr",
      |     ^^^^^^^^^^^^^^^^^^^
      |
  note: first defined here
     --> src\imp\mod.rs:195:5
      |
  195 |     target_arch = "avr",
      |     ^^^^^^^^^^^^^^^^^^^
  help: remove this attribute
     --> src\imp\mod.rs:205:5
      |
  205 |     target_arch = "avr",
      |     ^^^^^^^^^^^^^^^^^^^
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes

  error: duplicated attribute
     --> src\imp\mod.rs:206:5
      |
  206 |     target_arch = "msp430",
      |     ^^^^^^^^^^^^^^^^^^^^^^
      |
  note: first defined here
     --> src\imp\mod.rs:196:5
      |
  196 |     target_arch = "msp430",
      |     ^^^^^^^^^^^^^^^^^^^^^^
  help: remove this attribute
     --> src\imp\mod.rs:206:5
      |
  206 |     target_arch = "msp430",
      |     ^^^^^^^^^^^^^^^^^^^^^^
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes

  error: duplicated attribute
     --> src\imp\mod.rs:210:5
      |
  210 |     feature = "critical-section",
      |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      |
  note: first defined here
     --> src\imp\mod.rs:194:5
      |
  194 |     feature = "critical-section",
      |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  help: remove this attribute
     --> src\imp\mod.rs:210:5
      |
  210 |     feature = "critical-section",
      |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes
```
  • Loading branch information
taiki-e committed Mar 27, 2024
1 parent 30918e8 commit 07856ba
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ if [[ "${rustc_version}" == *"nightly"* ]] || [[ "${rustc_version}" == *"dev"* ]
check_cfg+=" --check-cfg=cfg(portable_atomic_target_feature,values($(IFS=',' && echo "${known_target_feature_values[*]}")))"
check_cfg+=" --check-cfg=cfg($(IFS=',' && echo "${known_cfgs[*]}"))"
subcmd=clippy
# This lint is buggy and also crate-level #![allow(..)] doesn't work.
# https://github.com/rust-lang/rust-clippy/issues/12537
# https://github.com/rust-lang/rust-clippy/issues/12538
export RUSTFLAGS="${RUSTFLAGS:-} -A clippy::duplicated_attributes"
rustup ${pre_args[@]+"${pre_args[@]}"} component add clippy &>/dev/null
target_dir="${target_dir}/check-cfg"
if [[ -n "${TESTS:-}" ]]; then
Expand Down

0 comments on commit 07856ba

Please sign in to comment.