-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
workspaces.dependencies causes ignore of default-features = false in crate #11329
Comments
A quick skim of the RFC implies to me that specifying |
It appears that my (poor) workaround for derive not working on That being said I think that |
fix(toml): Provide a way to show unused manifest keys for dependencies Dependencies have not been able to show unused manifest keys for some time, this problem partially resulted in #11329. This problem is caused by having an `enum` when deserializing. To get around this you can use: ```rust #[serde(flatten)] other: BTreeMap<String, toml::Value>, ``` This collects any unused keys into `other` that can later be used to show warnings. This idea was suggested in a thread I cannot find but is mentioned in [serde#941](serde-rs/serde#941).
Problem
When specifying a workspace dependency it is not obvious, and rather surprising that, not specifying
default-features = false
in the workspace dependency, means that anydefault-features = false
is ignored in any member crate.This I assume is because the features of workspace dependencies are additive, and by not specifying
default-features = false
, the default features are automatically and always enabled.Steps
default-features = false
.Possible Solution(s)
There are I think a couple solutions to this problem:
Possible Solution 1: Change the Default in workspace dependencies
This is probably not possible now that the feature is released, but it seems reasonable that workspace depenencies by default should not contribute any features unless explicitly specified. This would mean
default-features = false
by default in the workspace dependency.Position Solution 2: Display a warning if a member crate has default-features = false when workspace doesn't
If a workspace doesn't specify
default-features = false
, but a member crate does, this seems like an error, since the member crate will never achieve the effect ofdefault-features = false
. A warning would go a long way to help educate and catch this mistake. The warning for this would be similar to how cargo warns if you include patch entries that aren't getting used.Notes
No response
Version
The text was updated successfully, but these errors were encountered: