-
Notifications
You must be signed in to change notification settings - Fork 71
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
inherit stable annotations in enum variants and field items #370
Comments
This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed. |
@rustbot second |
Discussed at T-compiler meeting; we're going to put this through a full FCP process rather than the MCP seconding process. @rfcbot fcp merge |
Team member @pnkfelix has proposed to merge this. The next step is review by the rest of the tagged team members:
No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
@rfcbot reviewed I still think libstd is in a position where additional care regarding stability of its APIs warrants the annotation burden, but I don't have much reason to block this. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. The RFC will be merged soon. |
Closing as accepted. The PR is rust-lang/rust#71481 |
Proposal
Some time back, @estebank opened rust-lang/rust#71481 which proposed to fix rust-lang/rust#65515 by allowing stability attributes to be 'inherited'. The idea is that if you declare a struct/enum to be stable, then you are also declaring (by default) all of its public fields to be stable.
The primary motivation for the change is diagnostics. In our error messages, we sometimes print type declarations by excerpting from the source, and those currently contain various stability attributes that distract the user.
This change also reduces the annotation burden. As @estebank argues in #65515, it is quite unusual to have a stable struct/enum with public fields that are unstable (although I've not tried to verify this by inspection). In #65515, @alexcrichton commented:
@dtolnay commented, and @SimonSapin concurred:
The main downside is that if we DO have a struct that is stabilized, but we do not wish to stabilize its public fields, we have to remember to explicitly annotate those fields as UNSTABLE, as @nagisa pointed out.
Based on the above comments I believe the change makes sense, both for error messages and to reduce annotation burden.
Mentors or Reviewers
@estebank has already prepared the PR
Process
The main points of the Major Change Process is as follows:
@rustbot second
.-C flag
, then full team check-off is required.@rfcbot fcp merge
on either the MCP or the PR.You can read more about Major Change Proposals on forge.
Comments
This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.
The text was updated successfully, but these errors were encountered: