Features are supposed to be additive, so a feature to disable parts of a crate doesn’t make much sense. I like the idea of not building unstable items at all, though! I’m currently imagining something like this:
-
rustcgains awareness of item stability. Up to one stability attribute per item, and the fields are just documentation. - Everything that belongs to a top-level crate is built no matter what (otherwise
main()would have to be#[stable], for example). - By default, dependencies only have their stable and unspecified items built. Rust gains a new
extern crateattribute,#[unstable_use], which is basically#[macro_use]but for unstable items. -
rustcdoes not gain awareness of crate stability. Instead, Cargo is responsible for ensuring that >=1.0.0crates are sound (i.e. contain either no publically-visible items, or at least one publically-visible stable item; eventually unspecified items will be banned as well).
Thoughts?