1
-
2
1
# Request for stabilization
3
2
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.
7
6
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
12
11
13
12
## Documentation PRs
14
13
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
+ Prepare PRs to update documentations involing this new feature.
15
+ You need to submit PRs for repositories The Reference, The Book
16
+ and Rust by Example.
17
+ Maintainers of these repositories will keep these PRs open until
18
+ the whole stabilization process has completed. Meanwhile, we can
19
+ proceed to the next step.
21
20
22
21
## Write a stabilization report
23
22
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.
23
+ Find the tracking issue of the feature, and create a short
24
+ stabilization report. Essentially this would be a brief summary
25
+ of the feature plus some links to test cases showing it works
26
+ as expected, along with a list of edge cases that came up and
27
+ and were considered. This is a minimal "due diligence" that
28
+ we do before stabilizing.
30
29
31
- The report should contain:
30
+ The report should contain:
32
31
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).
32
+ - A summary, showing examples (e.g. code snippets) what is
33
+ enabled by this feature.
34
+ - Links to test cases in our test suite regarding this feature
35
+ and describe the feature's behavior on encountering edge cases.
36
+ - Links to the documentations (the PRs we have made in the
37
+ previous steps).
38
+ - Any other relevant information(Examples of such reports can
39
+ be found in rust-lang/rust #44494 and rust-lang/rust #28237 ).
41
40
42
41
## FCP
43
42
@@ -46,9 +45,9 @@ feature agrees with stabilizing this feature, they will
46
45
start the FCP (final-comment-period) process by
47
46
commenting
48
47
49
- ```bash
50
- @rfcbot fcp merge
51
- ```
48
+ ``` bash
49
+ @rfcbot fcp merge
50
+ ```
52
51
53
52
The rest of the team members will review the proposal. If the final
54
53
decision is to stabilize, we proceed to do the actual code modification.
@@ -75,19 +74,20 @@ macro. There should be an entry for the feature you are aiming to
75
74
stabilize, something like (this example is taken from
76
75
[ rust-lang/rust #32409 ] :
77
76
78
- ```
79
- // pub(restricted) visibilities (RFC 1422)
80
- (active, pub_restricted, "1.9.0", Some(32409)),
81
- ```
77
+ ``` rust
78
+ // pub(restricted) visibilities (RFC 1422)
79
+ (active , pub_restricted , " 1.9.0" , Some (32409 )),
80
+ ```
81
+
82
82
The above line should be moved down to the area for "accepted"
83
83
features, declared below in a separate call to ` declare_features! ` .
84
84
When it is done, it should look like:
85
85
86
- ```
87
- // pub(restricted) visibilities (RFC 1422)
88
- (accepted, pub_restricted, "1.31.0", Some(32409)),
89
- // ^^^^^^ note that we changed this
90
- ```
86
+ ``` rust
87
+ // pub(restricted) visibilities (RFC 1422)
88
+ (accepted , pub_restricted , " 1.31.0" , Some (32409 )),
89
+ // note that we changed this
90
+ ```
91
91
92
92
Note that, the version number is updated to be the version number
93
93
of the stable release where this feature will appear. This can be
@@ -120,40 +120,36 @@ stable). If the feature can be detected because it employs some
120
120
new syntax, then a common place for that code to be is in the
121
121
same ` feature_gate.rs ` . For example, you might see code like this:
122
122
123
- ```
124
- gate_feature_post!(&self, pub_restricted, span,
125
- "`pub(restricted)` syntax is experimental");
126
- ```
123
+ ``` rust
124
+ gate_feature_post! (& self , pub_restricted , span ,
125
+ " `pub(restricted)` syntax is experimental" );
126
+ ```
127
127
128
128
This ` gate_feature_post! ` macro prints an error if the
129
129
` pub_restricted ` feature is not enabled. It is not needed
130
130
now that ` #[pub_restricted] ` is stable.
131
131
132
132
For more subtle features, you may find code like this:
133
133
134
- ```
135
- if self.tcx.sess.features.borrow().pub_restricted { /* XXX */ }
136
- ```
134
+ ``` rust
135
+ if self . tcx. sess. features. borrow (). pub_restricted { /* XXX */ }
136
+ ```
137
137
138
138
This ` pub_restricted ` field (obviously named after the feature)
139
139
would ordinarily be false if the feature flag is not present
140
140
and true if it is. So transform the code to assume that the field
141
141
is true. In this case, that would mean removing the ` if ` and
142
142
leaving just the ` /* XXX */ ` .
143
143
144
- ```
145
- if self.tcx.sess.features.borrow().pub_restricted { /* XXX */ }
146
- ```
147
- becomes
148
144
``` rust
149
- /* XXX */
150
-
151
- if self . tcx. sess. features. borrow (). pub_restricted && something { /* XXX */ }
152
- ```
145
+ if self . tcx. sess. features. borrow (). pub_restricted { /* XXX */ }
153
146
becomes
154
- ```rust
155
- if something { /* XXX */ }
156
- ```
147
+ /* XXX */
148
+
149
+ if self . tcx. sess. features. borrow (). pub_restricted && something { /* XXX */ }
150
+ becomes
151
+ if something { /* XXX */ }
152
+ ```
157
153
158
154
## Updating documentation
159
155
@@ -169,15 +165,15 @@ If there wasn't documentation there, it needs to be added.
169
165
170
166
Places that may need updated documentation:
171
167
172
- [The Reference ]: this must be updated , in full detail .
173
- [The Book ]: this may or may not need updating , depending .
168
+ [The Reference]: This must be updated, in full detail.
169
+ [The Book]: This may or may not need updating, depends .
174
170
If you're not sure, please open an issue on this repository
175
171
and it can be discussed.
176
- standard library documentation : as needed . Language features
172
+ standard library documentation: As needed. Language features
177
173
often don't need this, but if it's a feature that changes
178
174
how good examples are written, such as when `?` was added
179
175
to the language, updating examples is important.
180
- [Rust by Example ]: as needed .
176
+ [Rust by Example]: As needed.
181
177
182
178
[ rust-lang/rust#32409 ] :https://github.com/rust-lang/rust/issues/32409
183
179
[ The Reference ] : https://github.com/rust-lang-nursery/reference
0 commit comments