Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e4ee951

Browse files
author
Niko Matsakis
committedJan 23, 2025·
stabilization template, docs
1 parent 8ebc7c0 commit e4ee951

3 files changed

+99
-36
lines changed
 

‎src/implementing_new_features.md

+19
Original file line numberDiff line numberDiff line change
@@ -204,3 +204,22 @@ tests/ui/feature-gates/ --bless`.
204204
[here]: ./stabilization_guide.md
205205
[tracking issue]: #tracking-issues
206206
[add-feature-gate]: ./feature-gates.md#adding-a-feature-gate
207+
208+
## Call for testing
209+
210+
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 two example [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.
211+
212+
## Affiliated work
213+
214+
Once the feature is supported by rustc, there is other associated work that needs to be done to give users a complete experience:
215+
216+
* Extending rustfmt to format any new syntax;
217+
* Extending rust-analyzer;
218+
* Documenting the feature in the Rust reference;
219+
* ...
220+
221+
## Stabilization
222+
223+
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].
224+
225+
[stab]: ./stabilization_guide.md

‎src/stabilization_guide.md

+26-36
Original file line numberDiff line numberDiff line change
@@ -43,44 +43,14 @@ has completed. Meanwhile, we can proceed to the next step.
4343

4444
## Write a stabilization report
4545

46-
Find the tracking issue of the feature, and create a short
47-
stabilization report. Essentially this would be a brief summary
48-
of the feature plus some links to test cases showing it works
49-
as expected, along with a list of edge cases that came up
50-
and were considered. This is a minimal "due diligence" that
51-
we do before stabilizing.
52-
53-
The report should contain:
54-
55-
- A summary, showing examples (e.g. code snippets) what is
56-
enabled by this feature.
57-
- Links to test cases in our test suite regarding this feature
58-
and describe the feature's behavior on encountering edge cases.
59-
- Links to the documentations (the PRs we have made in the
60-
previous steps).
61-
- Any other relevant information.
62-
- The resolutions of any unresolved questions if the stabilization
63-
is for an RFC.
64-
65-
Examples of stabilization reports can be found in
66-
[rust-lang/rust#44494][report1] and [rust-lang/rust#28237][report2] (these links
67-
will bring you directly to the comment containing the stabilization report).
68-
69-
[report1]: https://github.com/rust-lang/rust/issues/44494#issuecomment-360191474
70-
[report2]: https://github.com/rust-lang/rust/issues/28237#issuecomment-363374130
71-
72-
## FCP
73-
74-
If any member of the team responsible for tracking this
75-
feature agrees with stabilizing this feature, they will
76-
start the FCP (final-comment-period) process by commenting
46+
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.
7749

78-
```text
79-
@rfcbot fcp merge
80-
```
50+
[srt]: ./stabilization_report_template.md
8151

82-
The rest of the team members will review the proposal. If the final
83-
decision is to stabilize, we proceed to do the actual code modification.
52+
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
8454

8555
## Stabilization PR
8656

@@ -194,3 +164,23 @@ if something { /* XXX */ }
194164
[Rust by Example]: https://github.com/rust-lang/rust-by-example
195165
[`Unstable Book`]: https://doc.rust-lang.org/unstable-book/index.html
196166
[`src/doc/unstable-book`]: https://github.com/rust-lang/rust/tree/master/src/doc/unstable-book
167+
168+
## Lang team nomination
169+
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:
171+
172+
* `@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
176+
177+
## FCP proposed on the PR
178+
179+
Finally, some member of the team responsible for tracking this feature agrees with stabilizing this feature, will
180+
start the FCP (final-comment-period) process by commenting
181+
182+
```text
183+
@rfcbot fcp merge
184+
```
185+
186+
The rest of the team members will review the proposal. If the final decision is to stabilize, the PR will be reviewed by the compiler team like any other PR.

‎src/stabilization_report_template.md

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Stabilization report template
2+
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.
4+
5+
## General design
6+
7+
### What is the RFC for this feature and what changes have occurred to the user-facing design since the RFC was finalized?
8+
9+
### What behavior are we committing to that has been controversial? Summarize the major arguments pro/con.
10+
11+
### Are there extensions to this feature that remain unstable? How do we know that we are not accidentally committing to those?
12+
13+
## Has a call-for-testing period been conducted? If so, what feedback was received?
14+
15+
## Implementation quality
16+
17+
### Summarize the major parts of the implementation and provide links into the code (or to PRs)
18+
19+
An example for async closures: https://rustc-dev-guide.rust-lang.org/coroutine-closures.html
20+
21+
### Summarize existing test coverage of this feature
22+
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?
28+
29+
### What outstanding bugs in the issue tracker involve this feature? Are they stabilization-blocking?
30+
31+
### Summarize contributors to the feature by name for recognition and assuredness that people involved in the feature agree with stabilization
32+
33+
### What FIXMEs are still in the code for that feature and why is it ok to leave them there?
34+
35+
### Which tools need to be adjusted to support this feature. Has this work been done?
36+
37+
*Consider rustdoc, clippy, rust-analyzer, rustfmt, rustup, docs.rs.*
38+
39+
## Type system and execution rules
40+
41+
### What compilation-time checks are done that are needed to prevent undefined behavior?
42+
43+
(Be sure to link to tests demonstrating that these tests are being done.)
44+
45+
### Can users use this feature to introduce undefined behavior? (Describe.)
46+
47+
### What updates are needed to the reference/specification? (link to PRs when they exist)
48+
49+
## Common interactions
50+
51+
### Does this feature introduce new expressions and can they produce temporaries? What are the lifetimes of those temporaries?
52+
53+
### What other unstable features may be exposed by this feature?
54+

0 commit comments

Comments
 (0)
Please sign in to comment.