Cargo should allow features/optional-dependencies to be private or public, private by default #7769
Labels
A-features
Area: features — conditional compilation
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
A feature of a crate is part of its public API, but many crate authors don't realise this and constantly re-arrange their features. This in fact breaks semver, because someone depending on e.g.
cc/rayon
(present in version1.0.37
) will have this broken bycc
version1.0.47
which does not have this feature. What one should actually be depending on is theparallel
feature which points torayon
in version1.0.37
, but points instead tonum_cpus, jobserver
in version1.0.47
thereby retaining semver compatibility.However the fact that the "public/private"-ness of features is not even typically discussed, means that many crate authors are unaware of this, and freely add and remove features/optional-dependencies from their crates without thinking about semver compatibility.
Not sure if this is related to #6129 or not - that issue seems more to be about the
--extern
flag torustc
.The text was updated successfully, but these errors were encountered: