Skip to content

Commit b911da2

Browse files
author
Rajkumar Natarajan
committed
issue_180 incorporated the review comments
1 parent 3590fb3 commit b911da2

File tree

1 file changed

+59
-63
lines changed

1 file changed

+59
-63
lines changed

src/stabilization_guide.md

+59-63
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,42 @@
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+
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.
2120

2221
## Write a stabilization report
2322

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.
3029

31-
The report should contain:
30+
The report should contain:
3231

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).
4140

4241
## FCP
4342

@@ -46,9 +45,9 @@ feature agrees with stabilizing this feature, they will
4645
start the FCP (final-comment-period) process by
4746
commenting
4847

49-
```bash
50-
@rfcbot fcp merge
51-
```
48+
```bash
49+
@rfcbot fcp merge
50+
```
5251

5352
The rest of the team members will review the proposal. If the final
5453
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
7574
stabilize, something like (this example is taken from
7675
[rust-lang/rust#32409]:
7776

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+
8282
The above line should be moved down to the area for "accepted"
8383
features, declared below in a separate call to `declare_features!`.
8484
When it is done, it should look like:
8585

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+
```
9191

9292
Note that, the version number is updated to be the version number
9393
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
120120
new syntax, then a common place for that code to be is in the
121121
same `feature_gate.rs`. For example, you might see code like this:
122122

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+
```
127127

128128
This `gate_feature_post!` macro prints an error if the
129129
`pub_restricted` feature is not enabled. It is not needed
130130
now that `#[pub_restricted]` is stable.
131131

132132
For more subtle features, you may find code like this:
133133

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+
```
137137

138138
This `pub_restricted` field (obviously named after the feature)
139139
would ordinarily be false if the feature flag is not present
140140
and true if it is. So transform the code to assume that the field
141141
is true. In this case, that would mean removing the `if` and
142142
leaving just the `/* XXX */`.
143143

144-
```
145-
if self.tcx.sess.features.borrow().pub_restricted { /* XXX */ }
146-
```
147-
becomes
148144
```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 */ }
153146
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+
```
157153

158154
## Updating documentation
159155

@@ -169,15 +165,15 @@ If there wasn't documentation there, it needs to be added.
169165

170166
Places that may need updated documentation:
171167

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.
174170
If you're not sure, please open an issue on this repository
175171
and it can be discussed.
176-
standard library documentation: as needed. Language features
172+
standard library documentation: As needed. Language features
177173
often don't need this, but if it's a feature that changes
178174
how good examples are written, such as when `?` was added
179175
to the language, updating examples is important.
180-
[Rust by Example]: as needed.
176+
[Rust by Example]: As needed.
181177

182178
[rust-lang/rust#32409]:https://github.com/rust-lang/rust/issues/32409
183179
[The Reference]: https://github.com/rust-lang-nursery/reference

0 commit comments

Comments
 (0)