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
+ 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.
21
39
22
40
## Write a stabilization report
23
41
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.
30
48
31
- The report should contain:
49
+ The report should contain:
32
50
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 ).
41
59
42
60
## FCP
43
61
@@ -46,9 +64,9 @@ feature agrees with stabilizing this feature, they will
46
64
start the FCP (final-comment-period) process by
47
65
commenting
48
66
49
- ```bash
50
- @rfcbot fcp merge
51
- ```
67
+ ``` bash
68
+ @rfcbot fcp merge
69
+ ```
52
70
53
71
The rest of the team members will review the proposal. If the final
54
72
decision 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
75
93
stabilize, something like (this example is taken from
76
94
[ rust-lang/rust #32409 ] :
77
95
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
+
82
101
The above line should be moved down to the area for "accepted"
83
102
features, declared below in a separate call to ` declare_features! ` .
84
103
When it is done, it should look like:
85
104
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
+ ```
91
110
92
111
Note that, the version number is updated to be the version number
93
112
of 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
120
139
new syntax, then a common place for that code to be is in the
121
140
same ` feature_gate.rs ` . For example, you might see code like this:
122
141
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
+ ```
127
146
128
147
This ` gate_feature_post! ` macro prints an error if the
129
148
` pub_restricted ` feature is not enabled. It is not needed
130
149
now that ` #[pub_restricted] ` is stable.
131
150
132
151
For more subtle features, you may find code like this:
133
152
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
+ ```
137
156
138
157
This ` pub_restricted ` field (obviously named after the feature)
139
158
would ordinarily be false if the feature flag is not present
140
159
and true if it is. So transform the code to assume that the field
141
160
is true. In this case, that would mean removing the ` if ` and
142
161
leaving just the ` /* XXX */ ` .
143
162
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 */ }
147
165
becomes
148
- ``` rust
149
- /* XXX */
166
+ /* XXX */
150
167
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
+ ```
181
172
182
173
[ rust-lang/rust#32409 ] :https://github.com/rust-lang/rust/issues/32409
183
174
[ The Reference ] : https://github.com/rust-lang-nursery/reference
0 commit comments