Skip to content

Commit f5c45af

Browse files
jieyouxutraviscross
authored andcommitted
Address review feedback
- Address Call for Testing review feedback - Address Affiliated work review feedback - Drop "stabilization is easy" part - Fix broken feature gate examples - Elaborate on stabilization report summarization aspects - Recommend waiting a bit for team nominations - Make Stabilization Template markdown copy friendly - Register stabilization report template - Drop unfinished sentence - Clarify stabilization report template is for language features - Add test coverage elaboration - Add UB checks / opt question - Amend test coverage explanation - Mention OSS nightly users
1 parent c079ff9 commit f5c45af

File tree

4 files changed

+124
-51
lines changed

4 files changed

+124
-51
lines changed

src/SUMMARY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@
5353
- [Walkthrough: a typical contribution](./walkthrough.md)
5454
- [Implementing new language features](./implementing_new_features.md)
5555
- [Stability attributes](./stability.md)
56-
- [Stabilizing Features](./stabilization_guide.md)
56+
- [Stabilizing language features](./stabilization_guide.md)
57+
- [Stabilization report template](./stabilization_report_template.md)
5758
- [Feature Gates](./feature-gates.md)
5859
- [Coding conventions](./conventions.md)
5960
- [Procedures for breaking changes](./bug-fix-procedure.md)

src/implementing_new_features.md

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,19 +209,39 @@ tests/ui/feature-gates/ --bless`.
209209

210210
## Call for testing
211211

212-
Once the implementation is complete, the feature will be available to nightly users, but not yet part of stable Rust. This is a good time to write a blog post on [one of the Rust blogs](https://github.com/rust-lang/blog.rust-lang.org/) and issue a call for testing (here are three [example](https://blog.rust-lang.org/2021/08/03/GATs-stabilization-push.html) [blog](https://blog.rust-lang.org/inside-rust/2024/08/09/async-closures-call-for-testing.html) [posts](https://blog.rust-lang.org/2024/09/05/impl-trait-capture-rules.html) to give you the idea). The post should highlight how the feature works, what areas you'd like people to play with, and how they can supply feedback.
212+
Once the implementation is complete, the feature will be available to nightly users, but not yet part of stable Rust. This is a good time to write a blog post on [the main Rust blog][rust-blog] and issue a **Call for Testing**.
213+
214+
Some example Call for Testing blog posts:
215+
216+
1. [The push for GATs stabilization](https://blog.rust-lang.org/2021/08/03/GATs-stabilization-push/)
217+
2. [Changes to `impl Trait` in Rust 2024](https://blog.rust-lang.org/2024/09/05/impl-trait-capture-rules.html)
218+
3. [Async Closures MVP: Call for Testing!](https://blog.rust-lang.org/inside-rust/2024/08/09/async-closures-call-for-testing/)
219+
220+
Alternatively, [*This Week in Rust*][twir] has a [call-for-testing section][twir-cft]. Example:
221+
222+
- [Call for testing on boolean literals as cfg predicates](https://github.com/rust-lang/rust/issues/131204#issuecomment-2569314526).
223+
224+
Which option to choose might depend on how significant the language change is, though note that [*This Week in Rust*][twir]'s Call for Testing section might be less visible than a dedicated post on the main Rust blog.
213225

214226
## Affiliated work
215227

216-
Once the feature is supported by rustc, there is other associated work that needs to be done to give users a complete experience:
228+
Once the feature is supported by rustc, there is other associated work that needs to be done to give users a complete experience. Think of it as the *language toolchain* developer experience, which doesn't only comprise of the language or compiler in isolation.
217229

218-
* Extending rustfmt to format any new syntax;
219-
* Extending rust-analyzer;
220-
* Documenting the feature in the Rust reference;
221-
* ...
230+
- Documenting the language feature in the [Rust Reference][reference].
231+
- (If applicable) Extending [`rustfmt`] to format any new syntax.
232+
- (If applicable) Extending [`rust-analyzer`]. This can depend on the nature of the language feature, as some features don't need to be blocked on *full* support.
233+
- A blocking concern is when a language feature degrades the user experience simply by existing before its support is implemented in [`rust-analyzer`].
234+
- Example blocking concern: new syntax that [`rust-analyzer`] can't parse -> bogus diagnostics, type inference changes -> bogus diagnostics.
222235

223236
## Stabilization
224237

225238
The final step in the feature lifecycle is [stabilization][stab], which is when the feature becomes available to all Rust users. At this point, backwards incompatible changes are no longer permitted (modulo soundness bugs and inference changes; see the lang team's [defined semver policies](https://rust-lang.github.io/rfcs/1122-language-semver.html) for full details). To learn more about stabilization, see the [stabilization guide][stab].
226239

240+
227241
[stab]: ./stabilization_guide.md
242+
[rust-blog]: https://github.com/rust-lang/blog.rust-lang.org/
243+
[twir]: https://github.com/rust-lang/this-week-in-rust
244+
[twir-cft]: https://this-week-in-rust.org/blog/2025/01/22/this-week-in-rust-583/#calls-for-testing
245+
[`rustfmt`]: https://github.com/rust-lang/rustfmt
246+
[`rust-analyzer`]: https://github.com/rust-lang/rust-analyzer
247+
[reference]: https://github.com/rust-lang/reference

src/stabilization_guide.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,24 @@ has completed. Meanwhile, we can proceed to the next step.
4444
## Write a stabilization report
4545

4646
Author a stabilization report using the [template found in this repository][srt].
47-
Stabilization reports summarize the work that has been done since the RFC.
48-
The [template][srt] includes a series of questions that aim to surface interconnections between this feature and the various Rust teams (lang, types, etc) and also to identify items that are commonly overlooked.
47+
48+
Stabilization reports summarize:
49+
50+
- The main design decisions and deviations since the RFC was accepted, particularly decisions that were FCP'd or otherwise accepted by the language team.
51+
- Quite often, the final stabilized language feature can have significant design deviations from the original RFC text.
52+
- The work that has been done since the RFC was accepted, acknowledging the main contributors that helped drive the language feature forward.
53+
54+
The [*Stabilization Template*][srt] includes a series of questions that aim to surface interconnections between this feature and the various Rust teams (lang, types, etc) and also to identify items that are commonly overlooked.
4955

5056
[srt]: ./stabilization_report_template.md
5157

5258
The stabilization report is typically posted as the main comment on the stabilization PR (see the next section).
53-
If you'd like to develop the stabilization report incrementally, we recommend adding it to
5459

5560
## Stabilization PR for a language feature
5661

5762
*This is for stabilizing language features. If you are stabilizing a library
5863
feature, see [the stabilization chapter of the std dev guide][std-guide-stabilization] instead.*
5964

60-
Once we have decided to stabilize a feature, we need to have
61-
a PR that actually makes that stabilization happen. These kinds
62-
of PRs are a great way to get involved in Rust, as they take
63-
you on a little tour through the source code.
64-
6565
Here is a general guide to how to stabilize a feature --
6666
every feature is different, of course, so some features may
6767
require steps beyond what this guide talks about.
@@ -121,8 +121,7 @@ same `compiler/rustc_ast_passes/src/feature_gate.rs`.
121121
For example, you might see code like this:
122122

123123
```rust,ignore
124-
gate_feature_post!(&self, pub_restricted, span,
125-
"`pub(restricted)` syntax is experimental");
124+
gate_all!(pub_restricted, "`pub(restricted)` syntax is experimental");
126125
```
127126

128127
This `gate_feature_post!` macro prints an error if the
@@ -132,7 +131,7 @@ now that `#[pub_restricted]` is stable.
132131
For more subtle features, you may find code like this:
133132

134133
```rust,ignore
135-
if self.tcx.sess.features.borrow().pub_restricted { /* XXX */ }
134+
if self.tcx.features().async_fn_in_dyn_trait() { /* XXX */ }
136135
```
137136

138137
This `pub_restricted` field (obviously named after the feature)
@@ -165,14 +164,16 @@ if something { /* XXX */ }
165164
[`Unstable Book`]: https://doc.rust-lang.org/unstable-book/index.html
166165
[`src/doc/unstable-book`]: https://github.com/rust-lang/rust/tree/master/src/doc/unstable-book
167166

168-
## Lang team nomination
167+
## Team nominations
169168

170-
When you feel the PR is ready for consideration by the lang team, you can [nominate the PR](https://lang-team.rust-lang.org/how_to/nominate.html) to get it on the list for discussion in the next meeting. You should also cc the other interacting teams to review the report:
169+
After the stabilization PR is opened with the stabilization report, wait a bit for potential immediate comments. When such immediate comments "simmer down" and you feel the PR is ready for consideration by the lang team, you can [nominate the PR](https://lang-team.rust-lang.org/how_to/nominate.html) to get it on the list for discussion in the next meeting. You should also cc the other interacting teams when applicable to review the language feature being stabilized and the stabilization report:
171170

172171
* `@rust-lang/types`, to look for type system interactions
173-
* `@rust-lang/compiler`, to vouch for implementation quality
174-
* `@rust-lang/opsem`, but only if this feature interacts with unsafe code and can create undefined behavior
175-
* `@rust-lang/libs-api`, but only if there are additions to the standard library
172+
* `@rust-lang/compiler`, to review implementation robustness
173+
* `@rust-lang/opsem`, if this feature interacts with unsafe code and can create undefined behavior
174+
* `@rust-lang/libs-api`, if there are additions to the standard library that affects standard library API or their guarantees
175+
176+
If you are not an organization member, you can simply ask your assigned reviewer to cc the relevant teams on your behalf.
176177

177178
## FCP proposed on the PR
178179

src/stabilization_report_template.md

Lines changed: 79 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,105 @@
11
# Stabilization report template
22

3-
> **What is this?** This is a template to use for [stabilization reports](./stabilization_guide.md). It consists of a series of questions that aim to provide the information most commonly needed and to help reviewers be more likely to identify potential problems up front. Not all parts of the template will apply to all stabilizations. Feel free to put N/A if a question doesn't seem to apply to your case.
3+
> **What is this?**
4+
>
5+
> This is a template to use for [stabilization reports](./stabilization_guide.md) of **language features**. It consists of a series of questions that aim to provide the information most commonly needed and to help reviewers be more likely to identify potential problems up front. Not all parts of the template will apply to all stabilizations. Feel free to put N/A if a question doesn't seem to apply to your case.
6+
>
7+
> You can copy the following template after the separator and edit it as Markdown, replacing the *TODO* placeholders with answers.
48
5-
## General design
9+
---
610

7-
### What is the RFC for this feature and what changes have occurred to the user-facing design since the RFC was finalized?
11+
> ## General design
812
9-
### What behavior are we committing to that has been controversial? Summarize the major arguments pro/con.
13+
> ### What is the RFC for this feature and what changes have occurred to the user-facing design since the RFC was finalized?
1014
11-
### Are there extensions to this feature that remain unstable? How do we know that we are not accidentally committing to those?
15+
*TODO*
1216

13-
## Has a call-for-testing period been conducted? If so, what feedback was received?
17+
> ### What behavior are we committing to that has been controversial? Summarize the major arguments pro/con.
1418
15-
## Implementation quality
19+
*TODO*
1620

17-
### Summarize the major parts of the implementation and provide links into the code (or to PRs)
21+
> ### Are there extensions to this feature that remain unstable? How do we know that we are not accidentally committing to those?
1822
19-
An example for async closures: https://rustc-dev-guide.rust-lang.org/coroutine-closures.html
23+
*TODO*
2024

21-
### Summarize existing test coverage of this feature
25+
> ## Has a Call for Testing period been conducted? If so, what feedback was received?
26+
>
27+
> Does any OSS nightly users use this feature? For instance, a useful indication might be "search <grep.app> for `#![feature(FEATURE_NAME)]` and had `N` results".
2228
23-
- What does the test coverage landscape for this feature look like?
24-
- (Positive/negative) Behavioral tests?
25-
- (Positive/negative) Interface tests? (e.g. compiler cli interface)
26-
- Maybe link to test folders or individual tests (ui/codegen/assembly/run-make tests, etc.)
27-
- Are there any (intentional/unintentional) gaps in test coverage?
29+
*TODO*
2830

29-
### What outstanding bugs in the issue tracker involve this feature? Are they stabilization-blocking?
31+
> ## Implementation quality
3032
31-
### What FIXMEs are still in the code for that feature and why is it ok to leave them there?
33+
*TODO*
3234

33-
### Summarize contributors to the feature by name for recognition and assuredness that people involved in the feature agree with stabilization
35+
> ### Summarize the major parts of the implementation and provide links into the code (or to PRs)
36+
>
37+
> An example for async closures: <https://rustc-dev-guide.rust-lang.org/coroutine-closures.html>.
3438
35-
### Which tools need to be adjusted to support this feature. Has this work been done?
39+
*TODO*
3640

37-
*Consider rustdoc, clippy, rust-analyzer, rustfmt, rustup, docs.rs.*
41+
> ### Summarize existing test coverage of this feature
42+
>
43+
> Consider what the "edges" of this feature are. We're particularly interested in seeing tests that assure us about exactly what nearby things we're not stabilizing.
44+
>
45+
> Within each test, include a comment at the top describing the purpose of the test and what set of invariants it intends to demonstrate. This is a great help to those reviewing the tests at stabilization time.
46+
>
47+
> - What does the test coverage landscape for this feature look like?
48+
> - Tests for compiler errors when you use the feature wrongly or make mistakes?
49+
> - Tests for the feature itself:
50+
> - Limits of the feature (so failing compilation)
51+
> - Exercises of edge cases of the feature
52+
> - Tests that checks the feature works as expected (where applicable, `//@ run-pass`).
53+
> - Are there any intentional gaps in test coverage?
54+
>
55+
> Link to test folders or individual tests (ui/codegen/assembly/run-make tests, etc.).
3856
39-
## Type system and execution rules
57+
*TODO*
4058

41-
### What compilation-time checks are done that are needed to prevent undefined behavior?
59+
> ### What outstanding bugs in the issue tracker involve this feature? Are they stabilization-blocking?
4260
43-
(Be sure to link to tests demonstrating that these tests are being done.)
61+
*TODO*
4462

45-
### Can users use this feature to introduce undefined behavior, or use this feature to break the abstraction of Rust and expose the underlying assembly-level implementation? (Describe.)
63+
> ### What FIXMEs are still in the code for that feature and why is it ok to leave them there?
4664
47-
### What updates are needed to the reference/specification? (link to PRs when they exist)
65+
*TODO*
4866

49-
## Common interactions
67+
> ### Summarize contributors to the feature by name for recognition and assuredness that people involved in the feature agree with stabilization
5068
51-
### Does this feature introduce new expressions and can they produce temporaries? What are the lifetimes of those temporaries?
69+
*TODO*
5270

53-
### What other unstable features may be exposed by this feature?
71+
> ### Which tools need to be adjusted to support this feature. Has this work been done?
72+
>
73+
> Consider rustdoc, clippy, rust-analyzer, rustfmt, rustup, docs.rs.
5474
75+
*TODO*
76+
77+
> ## Type system and execution rules
78+
79+
> ### What compilation-time checks are done that are needed to prevent undefined behavior?
80+
>
81+
> (Be sure to link to tests demonstrating that these tests are being done.)
82+
83+
*TODO*
84+
85+
> ### Does the feature's implementation need checks to prevent UB or is it sound by default and needs opt in in places to perform the dangerous/unsafe operations? If it is not sound by default, what is the rationale?
86+
87+
*TODO*
88+
89+
> ### Can users use this feature to introduce undefined behavior, or use this feature to break the abstraction of Rust and expose the underlying assembly-level implementation? (Describe.)
90+
91+
*TODO*
92+
93+
> ### What updates are needed to the reference/specification? (link to PRs when they exist)
94+
95+
*TODO*
96+
97+
> ## Common interactions
98+
99+
> ### Does this feature introduce new expressions and can they produce temporaries? What are the lifetimes of those temporaries?
100+
101+
*TODO*
102+
103+
> ### What other unstable features may be exposed by this feature?
104+
105+
*TODO*

0 commit comments

Comments
 (0)