-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
duplicated_attributes false positive: cfg expressions #12537
Comments
@GuillaumeGomez @blyxyas (the lint is new from #12378) |
rust-lang/rust-clippy#12537 warning: duplicated attribute --> src/c_char.rs:28:17 | 28 | any(target_arch = "aarch64", target_arch = "arm") | ^^^^^^^^^^^^^^^^^^^^^^^ | note: first defined here --> src/c_char.rs:16:17 | 16 | target_arch = "aarch64", | ^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute --> src/c_char.rs:28:17 | 28 | any(target_arch = "aarch64", target_arch = "arm") | ^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes = note: `#[warn(clippy::duplicated_attributes)]` on by default warning: duplicated attribute --> src/c_char.rs:28:42 | 28 | any(target_arch = "aarch64", target_arch = "arm") | ^^^^^^^^^^^^^^^^^^^ | note: first defined here --> src/c_char.rs:17:17 | 17 | target_arch = "arm", | ^^^^^^^^^^^^^^^^^^^ help: remove this attribute --> src/c_char.rs:28:42 | 28 | any(target_arch = "aarch64", target_arch = "arm") | ^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes warning: duplicated attribute --> src/c_char.rs:34:17 | 34 | target_arch = "aarch64", | ^^^^^^^^^^^^^^^^^^^^^^^ | note: first defined here --> src/c_char.rs:16:17 | 16 | target_arch = "aarch64", | ^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute --> src/c_char.rs:34:17 | 34 | target_arch = "aarch64", | ^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes warning: duplicated attribute --> src/c_char.rs:35:17 | 35 | target_arch = "arm", | ^^^^^^^^^^^^^^^^^^^ | note: first defined here --> src/c_char.rs:17:17 | 17 | target_arch = "arm", | ^^^^^^^^^^^^^^^^^^^ help: remove this attribute --> src/c_char.rs:35:17 | 35 | target_arch = "arm", | ^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes warning: duplicated attribute --> src/c_char.rs:36:17 | 36 | target_arch = "powerpc", | ^^^^^^^^^^^^^^^^^^^^^^^ | note: first defined here --> src/c_char.rs:19:17 | 19 | target_arch = "powerpc", | ^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute --> src/c_char.rs:36:17 | 36 | target_arch = "powerpc", | ^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes warning: duplicated attribute --> src/c_char.rs:37:17 | 37 | target_arch = "powerpc64", | ^^^^^^^^^^^^^^^^^^^^^^^^^ | note: first defined here --> src/c_char.rs:20:17 | 20 | target_arch = "powerpc64", | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute --> src/c_char.rs:37:17 | 37 | target_arch = "powerpc64", | ^^^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes warning: duplicated attribute --> src/c_char.rs:38:17 | 38 | target_arch = "riscv64" | ^^^^^^^^^^^^^^^^^^^^^^^ | note: first defined here --> src/c_char.rs:22:17 | 22 | target_arch = "riscv64", | ^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute --> src/c_char.rs:38:17 | 38 | target_arch = "riscv64" | ^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes warning: duplicated attribute --> src/c_char.rs:43:17 | 43 | any(target_arch = "aarch64", target_arch = "arm", target_arch = "powerpc") | ^^^^^^^^^^^^^^^^^^^^^^^ | note: first defined here --> src/c_char.rs:16:17 | 16 | target_arch = "aarch64", | ^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute --> src/c_char.rs:43:17 | 43 | any(target_arch = "aarch64", target_arch = "arm", target_arch = "powerpc") | ^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes warning: duplicated attribute --> src/c_char.rs:43:42 | 43 | any(target_arch = "aarch64", target_arch = "arm", target_arch = "powerpc") | ^^^^^^^^^^^^^^^^^^^ | note: first defined here --> src/c_char.rs:17:17 | 17 | target_arch = "arm", | ^^^^^^^^^^^^^^^^^^^ help: remove this attribute --> src/c_char.rs:43:42 | 43 | any(target_arch = "aarch64", target_arch = "arm", target_arch = "powerpc") | ^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes warning: duplicated attribute --> src/c_char.rs:43:63 | 43 | any(target_arch = "aarch64", target_arch = "arm", target_arch = "powerpc") | ^^^^^^^^^^^^^^^^^^^^^^^ | note: first defined here --> src/c_char.rs:19:17 | 19 | target_arch = "powerpc", | ^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute --> src/c_char.rs:43:63 | 43 | any(target_arch = "aarch64", target_arch = "arm", target_arch = "powerpc") | ^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes warning: duplicated attribute --> src/c_char.rs:49:17 | 49 | target_arch = "aarch64", | ^^^^^^^^^^^^^^^^^^^^^^^ | note: first defined here --> src/c_char.rs:16:17 | 16 | target_arch = "aarch64", | ^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute --> src/c_char.rs:49:17 | 49 | target_arch = "aarch64", | ^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes warning: duplicated attribute --> src/c_char.rs:50:17 | 50 | target_arch = "arm", | ^^^^^^^^^^^^^^^^^^^ | note: first defined here --> src/c_char.rs:17:17 | 17 | target_arch = "arm", | ^^^^^^^^^^^^^^^^^^^ help: remove this attribute --> src/c_char.rs:50:17 | 50 | target_arch = "arm", | ^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes warning: duplicated attribute --> src/c_char.rs:51:17 | 51 | target_arch = "powerpc64", | ^^^^^^^^^^^^^^^^^^^^^^^^^ | note: first defined here --> src/c_char.rs:20:17 | 20 | target_arch = "powerpc64", | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute --> src/c_char.rs:51:17 | 51 | target_arch = "powerpc64", | ^^^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes warning: duplicated attribute --> src/c_char.rs:52:17 | 52 | target_arch = "powerpc" | ^^^^^^^^^^^^^^^^^^^^^^^ | note: first defined here --> src/c_char.rs:19:17 | 19 | target_arch = "powerpc", | ^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute --> src/c_char.rs:52:17 | 52 | target_arch = "powerpc" | ^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes warning: duplicated attribute --> src/c_char.rs:55:36 | 55 | all(target_os = "fuchsia", target_arch = "aarch64") | ^^^^^^^^^^^^^^^^^^^^^^^ | note: first defined here --> src/c_char.rs:45:36 | 45 | all(target_os = "openbsd", target_arch = "aarch64"), | ^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute --> src/c_char.rs:55:36 | 55 | all(target_os = "fuchsia", target_arch = "aarch64") | ^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes warning: `cxx` (lib) generated 15 warnings
You're right, it should not check |
Here is another false positive case found in Nix: #[cfg(any(
target_os = "freebsd",
target_os = "android",
all(target_os = "linux", target_arch = "s390x"),
all(target_os = "linux", target_env = "musl"),
all(target_os = "linux", target_env = "ohos"),
all(
target_os = "linux",
not(any(target_arch = "s390x", target_env = "musl"))
),
))]
#[derive(Eq, Copy, Clone, PartialEq, Debug)]
pub struct FsType(pub fs_type_t); Clippy suggests me to remove these "duplicate" linux attributes even though that they are actually not the same thing. Full log here: https://github.com/nix-rust/nix/blob/01cd697b82087730b00bafa60e25fd53b025cfdd/src/sys/statfs.rs#L77-L79 |
There's also a false positive when using https://crates.io/crates/test-case. #[test_case("pointer", false, None, 42)]
#[test_case("pointer", true, None, 21)]
#[test_case("struct_flavors", false, None, 1)]
#[test_case("struct_flavors", true, None, 2)]
fn relocation_tests(
program: &str,
with_relocations: bool,
required_kernel_version: Option<(KernelVersion, &str)>,
expected: u64,
) {
...
}
|
Don't emit `duplicated_attribute` lint on "complex" `cfg`s Part of #12537. changelog: Don't emit `duplicated_attribute` lint on "complex" `cfg`s
@GuillaumeGomez it'd be helpful if you pinged this issue when a new nightly is out with this fix. |
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 ```
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 ```
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 ```
I can ask @flip1995 for that when he does it. :) |
2024-04-05 |
Looks like #12555 did not fix this issue. Tested with |
Just tested locally and can't reproduce it. Just in case, I opened #12646 to ensure that attributes generated by proc-macros don't emit a warning. |
I'm able to reproduce with yesterday's (2024-04-07) nightly as well. If you want, you can revert aya-rs/aya@b552c83 locally and then run |
I'm starting to wonder if proc-macros don't need special treatment here... |
I'll do some testing =^w^= |
I am also having these issues. It seems like the current master still lints on it. You can try it by cloning the
|
Ok so that confirms that some tokens are not marked as "from expansion" in proc-macros. Gonna investigate a bit more. |
Also on
|
Yes got it. Still trying to write a minimal code to reproduce the bug. |
I tested #12646, and this should be fixed when that hits nightly :) |
Turn `duplicated_attributes` into a late lint Fixes #12537. changelog: Turn `duplicated_attributes` into a late lint
@GuillaumeGomez Still have the issue also on the last nightly
Clippy behaviour is still the same of #12537 (comment) |
@tamird I guess that also for |
Then please provide a minimal code I can use to reproduce the bug and fix it (and also use as regression test). |
Worth noting that the last change here (#12646) is, again, not on nightly yet, since the clippy subtree is only updated every 2 weeks. So it's entirely possible that it is fixed, just not on nightly yet and so we can't do anything but wait. It'd be useful to also run master clippy on the crate (like here) and see what happens there. |
I second y21's comment. If you're open to some testing, clone the repo (or pull master) and test it with a similar command. If that doesn't work, please report back! ❤️ |
@GuillaumeGomez I tested with Thanks!!! |
Perfect. :) Closing then! |
Lint Name
duplicated_attributes
Reproducer
Clippy just says "remove this attribute" but doing so would violate the intended meaning of the program.
The case shown as an example of the intended purpose of this lint in https://rust-lang.github.io/rust-clippy/master/index.html#/duplicated_attributes (
#[allow(dead_code)] #[allow(dead_code)]
) seems like a quite different thing than this one.Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: