1-
21# Request for stabilization
32
4- Once an unstable feature has been well-tested with no outstanding
5- concern, anyone may push for its stabilization. It involves the
6- following steps.
3+ Once an unstable feature has been well-tested with no outstanding
4+ concern, anyone may push for its stabilization. It involves the
5+ following steps.
76
8- - Documentation PRs
9- - Write a stabilization report
10- - FCP
11- - Stabilization PR
7+ - Documentation PRs
8+ - Write a stabilization report
9+ - FCP
10+ - Stabilization PR
1211
1312## Documentation PRs
1413
15- Prepare PRs to update documentations involing this new feature.
16- You need to submit PRs for repositories The Reference, The Book
17- and Rust by Example.
18- Maintainers of these repositories will keep these PRs open until
19- the whole stabilization process has completed. Meanwhile, we can
20- proceed to the next step.
14+ If any documentation for this feature exists, it should be
15+ in the ` Unstable Book ` , located at ` src/doc/unstable-book ` .
16+ If it exists, the page for the feature gate should be removed.
17+
18+ If there was documentation there, integrating it into the
19+ existing documentation is needed.
20+
21+ If there wasn't documentation there, it needs to be added.
22+
23+ Places that may need updated documentation:
24+
25+ [The Reference]: This must be updated, in full detail.
26+ [The Book]: This may or may not need updating, depends.
27+ If you're not sure, please open an issue on this repository
28+ and it can be discussed.
29+ standard library documentation: As needed. Language features
30+ often don't need this, but if it's a feature that changes
31+ how good examples are written, such as when `?` was added
32+ to the language, updating examples is important.
33+ [Rust by Example]: As needed.
34+
35+ Prepare PRs to update documentations invovling this new feature
36+ for repositories mentioned above.Maintainers of these repositories
37+ will keep these PRs open until the whole stabilization process
38+ has completed. Meanwhile, we can proceed to the next step.
2139
2240## Write a stabilization report
2341
24- Find the tracking issue of the feature, and create a short
25- stabilization report. Essentially this would be a brief summary
26- of the feature plus some links to test cases showing it works
27- as expected, along with a list of edge cases that came up and
28- and were considered. This is a minimal "due diligence" that
29- we do before stabilizing.
42+ Find the tracking issue of the feature, and create a short
43+ stabilization report. Essentially this would be a brief summary
44+ of the feature plus some links to test cases showing it works
45+ as expected, along with a list of edge cases that came up and
46+ and were considered. This is a minimal "due diligence" that
47+ we do before stabilizing.
3048
31- The report should contain:
49+ The report should contain:
3250
33- - A summary, showing examples (e.g. code snippets) what is
34- enabled by this feature.
35- - Links to test cases in our test suite regarding this feature
36- and describe the feature's behavior on encountering edge cases.
37- - Links to the documentations (the PRs we have made in the
38- previous steps).
39- - Any other relevant information(Examples of such reports can
40- be found in rust-lang/rust#44494 and rust-lang/rust#28237).
51+ - A summary, showing examples (e.g. code snippets) what is
52+ enabled by this feature.
53+ - Links to test cases in our test suite regarding this feature
54+ and describe the feature's behavior on encountering edge cases.
55+ - Links to the documentations (the PRs we have made in the
56+ previous steps).
57+ - Any other relevant information(Examples of such reports can
58+ be found in rust-lang/rust #44494 and rust-lang/rust #28237 ).
4159
4260## FCP
4361
@@ -46,9 +64,9 @@ feature agrees with stabilizing this feature, they will
4664start the FCP (final-comment-period) process by
4765commenting
4866
49- ```bash
50- @rfcbot fcp merge
51- ```
67+ ``` bash
68+ @rfcbot fcp merge
69+ ```
5270
5371The rest of the team members will review the proposal. If the final
5472decision is to stabilize, we proceed to do the actual code modification.
@@ -75,19 +93,20 @@ macro. There should be an entry for the feature you are aiming to
7593stabilize, something like (this example is taken from
7694[ rust-lang/rust #32409 ] :
7795
78- ```
79- // pub(restricted) visibilities (RFC 1422)
80- (active, pub_restricted, "1.9.0", Some(32409)),
81- ```
96+ ``` rust,ignore
97+ // pub(restricted) visibilities (RFC 1422)
98+ (active, pub_restricted, "1.9.0", Some(32409)),
99+ ```
100+
82101The above line should be moved down to the area for "accepted"
83102features, declared below in a separate call to ` declare_features! ` .
84103When it is done, it should look like:
85104
86- ```
87- // pub(restricted) visibilities (RFC 1422)
88- (accepted, pub_restricted, "1.31.0", Some(32409)),
89- // ^^^^^^ note that we changed this
90- ```
105+ ``` rust,ignore
106+ // pub(restricted) visibilities (RFC 1422)
107+ (accepted, pub_restricted, "1.31.0", Some(32409)),
108+ // note that we changed this
109+ ```
91110
92111Note that, the version number is updated to be the version number
93112of the stable release where this feature will appear. This can be
@@ -120,64 +139,36 @@ stable). If the feature can be detected because it employs some
120139new syntax, then a common place for that code to be is in the
121140same ` feature_gate.rs ` . For example, you might see code like this:
122141
123- ```
124- gate_feature_post!(&self, pub_restricted, span,
125- "`pub(restricted)` syntax is experimental");
126- ```
142+ ``` rust,ignore
143+ gate_feature_post!(&self, pub_restricted, span,
144+ "`pub(restricted)` syntax is experimental");
145+ ```
127146
128147This ` gate_feature_post! ` macro prints an error if the
129148` pub_restricted ` feature is not enabled. It is not needed
130149now that ` #[pub_restricted] ` is stable.
131150
132151For more subtle features, you may find code like this:
133152
134- ```
135- if self.tcx.sess.features.borrow().pub_restricted { /* XXX */ }
136- ```
153+ ``` rust,ignore
154+ if self.tcx.sess.features.borrow().pub_restricted { /* XXX */ }
155+ ```
137156
138157This ` pub_restricted ` field (obviously named after the feature)
139158would ordinarily be false if the feature flag is not present
140159and true if it is. So transform the code to assume that the field
141160is true. In this case, that would mean removing the ` if ` and
142161leaving just the ` /* XXX */ ` .
143162
144- ```
145- if self.tcx.sess.features.borrow().pub_restricted { /* XXX */ }
146- ```
163+ ``` rust,ignore
164+ if self.tcx.sess.features.borrow().pub_restricted { /* XXX */ }
147165becomes
148- ``` rust
149- /* XXX */
166+ /* XXX */
150167
151- if self . tcx. sess. features. borrow (). pub_restricted && something { /* XXX */ }
152- ```
153- becomes
154- ```rust
155- if something { /* XXX */ }
156- ```
157-
158- ## Updating documentation
159-
160- If any documentation for this feature exists , it should be
161- in the `Unstable Book `, located at `src / doc / unstable - book `.
162- If it exists , the page for the feature gate
163- should be removed .
164-
165- If there was documentation there , integrating it into the
166- existing documentation is needed .
167-
168- If there wasn 't documentation there , it needs to be added .
169-
170- Places that may need updated documentation :
171-
172- [The Reference ]: this must be updated , in full detail .
173- [The Book ]: this may or may not need updating , depending .
174- If you 're not sure , please open an issue on this repository
175- and it can be discussed .
176- standard library documentation : as needed . Language features
177- often don 't need this , but if it 's a feature that changes
178- how good examples are written , such as when `? ` was added
179- to the language , updating examples is important .
180- [Rust by Example ]: as needed .
168+ if self.tcx.sess.features.borrow().pub_restricted && something { /* XXX */ }
169+ becomes
170+ if something { /* XXX */ }
171+ ```
181172
182173[ rust-lang/rust#32409 ] :https://github.com/rust-lang/rust/issues/32409
183174[ The Reference ] : https://github.com/rust-lang-nursery/reference
0 commit comments