Open 0x5abe opened 11 months ago
Hey @SabeMP, I'd suggest the following. If we can find an example with serde
where this would be helpful, I'd be happy to add that as a dependency to the tests crate so we can validate this works consistently.
Also, could you undo the formatting changes?
Sometimes derive macros need a specific attribute to be above them to work properly. I ran across this while using bilge, where the TryFromBits derive macro requires the bitsize attribute above it. The
EnumDiscriminants
derive macro currently doesn't allow for arbitrary attribute macros before the generated enum's derives, so I added the#[strum_discriminants(attributes(..))]
attribute to allow for this.This PR is a draft because I am not entirely sure how a test for this specific attribute would be performed, and I wouldn't want it to get merged without its proper tests.