-
Notifications
You must be signed in to change notification settings - Fork 1.6k
RFC: Improve the visibility of the nightly compiler requirement for crates that use unstable features. #2038
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
Conversation
…rates that use unstable features.
While the issue this tries to solve is a very obvious one, Stabilization
Therefore the crate would still be flagged as nightly, even though it now works on stable. Another stabilization issue directly arises
Custom forksIn a corporate environment, forks of rust are possible. So they are stuck on an older rust (nightly) version, where feature How can you determine if the features required by this crate are available for your specific rust nightly? ConclusionI personally feel that an approach based on version ranges based E.g. showing on crates.io that Crate XY requires atleast Rust 1.19>= Determining the features being used could be a bit more complicated, but is certainly possible:
|
I am wary of cargo having to parse Rust code to detect the use of nightly features; is there a precedent for this? Otherwise I would find it cleaner for the declaration of nightly features used to be in the Cargo.toml and for cargo to pass this information as flags to rustc, replacing the need for declaring said features in the source code itself. Once the list is available in Cargo.toml, then it is relatively easy to check which compiler version is required for this to be stable on crates.io and indicate it as a tag. This tag would evolve in time whenever a new release of Rust occurs: for example, if the last feature requiring nightly on 1.19 is stabilised for 1.20, then the tag would move from |
@matthieu-m Surely one would need to keep But how would you get people to actually specify the features in their |
Related is this feature coming to crates.io Soon™: rust-lang/crates.io#764 |
Another issue the current RFC text doesn't address is crates that work fine on stable, but have optional cargo features that make use of unstable language features. |
Ninja Edit: What @lxrec said. I didn't see his post. ================================================================================= As an example, tcod-rs used Serde's derive prior to Rust 1.15 stabilizing the feature. But, the library kept the feature under the #[cfg] feature gate "Serialization". |
@carols10cents, since this is pretty related to your work on crates.io, I've assigned you to shepherd this RFC. |
@jimmycuadra To move this RFC forward, it sounds like it could use amendments to address:
Do you have any thoughts on how to address these issues? |
I've got some ideas about how to revise my proposal based on the feedback so far. I should be able to get to it soon. Everyone can hold off until I update the text. Thanks! |
I'm closing this until I have time to address feedback. I don't want to waste anyone's time. :} |
Rendered