-
Notifications
You must be signed in to change notification settings - Fork 76
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
Arbitrary derive doesn't play nicely with cfg_attr #149
Comments
Hm, that's strange, |
The cfg_attr is a red herring, the |
Oh weird, perhaps it's just because it's an enum variant. To be honest I haven't tried using that attribute with an enum before, only structs. I'll investigate a little further. |
Oh! The attribute needs to be on the field, not the variant. That explains that. We should perhaps throw an error if you use |
Closing as works-as-intended, but filed #150 for the diagnostics (and potentially making the case you laid out automatic) Thanks for reporting! |
No worries thanks for being so responsive! |
So I'm trying to keep the arbitrary crate as an optional dependency for a project. So I'd like to conditionally derive the arbitrary implementation e.g.
This works fine when every var/enum variant also implements derive (or I can implement it manually). However in this case
bigdecimal::BigDecimal
is in an external crate that I don't have control over so I'd like to be able to do something like this;Where I conditionally enable lambda implementation for that variant type. However for whatever reason this doesn't actually work and I get an error like;
The text was updated successfully, but these errors were encountered: