hobofan / ambassador

Delegation of trait implementations via procedural macros
Apache License 2.0
251 stars 13 forks source link

clippy on nightly complains about multiple attributes #57

Closed vigna closed 3 months ago

vigna commented 3 months ago

When performing multiple delegations, as in

#[delegate(crate::traits::rank_sel::BitLength, target = "bits")]
#[delegate(crate::traits::rank_sel::SelectZeroHinted, target = "bits")]

the nightly clippy complains about targetwith the (new, I guess) clippy::duplicated_attributes:

warning: duplicated attribute
   --> src/traits/rank_sel.rs:293:58
    |
293 | #[delegate(crate::traits::rank_sel::SelectZeroUnchecked, target = "bits")]
    |                                                          ^^^^^^^^^^^^^^^
    |
note: first defined here
   --> src/traits/rank_sel.rs:285:48
    |
285 | #[delegate(crate::traits::rank_sel::BitLength, target = "bits")]
    |                                                ^^^^^^^^^^^^^^^
help: remove this attribute
   --> src/traits/rank_sel.rs:293:58
    |
293 | #[delegate(crate::traits::rank_sel::SelectZeroUnchecked, target = "bits")]
    |                                                          ^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes
dewert99 commented 3 months ago

I can't seem to reproduce this, would you be able to provide the type you deriving Delagate for and the BitLength and SelectZeroHinted traits?

vigna commented 3 months ago

The traits are all there: https://github.com/vigna/sux-rs/blob/main/src/traits/rank_sel.rs An example structure causing the warning: https://github.com/vigna/sux-rs/blob/main/src/rank_sel/rank9.rs

Note that if you run clippy on the repo you will not get the warnings now as they have been disabled in lib.rs.

dewert99 commented 3 months ago

I think this is an issue with the lint itself not ambassador so I am closing this in favour of https://github.com/rust-lang/rust-clippy/issues/12923.

vigna commented 3 months ago

Definitely!