Replies: 8 comments 1 reply
-
Ideally it would still be Hmm, on stable Cargo it may be possible to work around it with a shim crate that re-exports from serde: [features]
serde = ["serde1", "geo-types/serde"]
[dependencies]
geo-types = "..."
serde1 = { version = "1.0", optional = true } I don't currently have a suggestion for a name other than |
Beta Was this translation helpful? Give feedback.
-
I've seen |
Beta Was this translation helpful? Give feedback.
-
@dtolnay as I found out the hard way, crates that use |
Beta Was this translation helpful? Give feedback.
-
If anyone else is looking for a way to just expose the feature as |
Beta Was this translation helpful? Give feedback.
-
Rather than use |
Beta Was this translation helpful? Give feedback.
-
@CAD97 in the library that exposes a feature called can't find crate for `serde`
--> zors_lib\src\visitable\mod.rs:9:38
|
9 | #[cfg_attr(feature = "serde", derive(Deserialize))]
| ^^^^^^^^^^^ can't find crate |
Beta Was this translation helpful? Give feedback.
-
... I could have sworn that I did this before and it worked. (It must have been for a project that was not using the derive, or with a macro that wasn't actually serde's.) But yes, now that I think about it, serde_derive does And this gets worse on nightly, because serde is in the sysroot 😞
|
Beta Was this translation helpful? Give feedback.
-
https://rust-lang-nursery.github.io/api-guidelines/naming.html#feature-names-are-free-of-placeholder-words-c-feature
What is the recommended naming convention for a serde feature flag that also enables serde feature flags of dependencies? As an example:
Beta Was this translation helpful? Give feedback.
All reactions