Skip to content

Commit 072e5eb

Browse files
ssbrJohnTitor
andauthored
Add symbol-addition to the how-to for new features (rust-lang#1457)
Co-authored-by: Yuki Okushi <[email protected]>
1 parent 9a579ec commit 072e5eb

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/doc/rustc-dev-guide/src/feature-gates.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ modifying feature gates.
99
See ["Stability in code"] for help with adding a new feature; this section just
1010
covers how to add the feature gate *declaration*.
1111

12-
Add a feature gate declaration to `rustc_feature/src/active.rs` in the active
12+
First, add the feature name to `rustc_span/src/symbol.rs` in the `Symbols {...}` block.
13+
14+
Then, add a feature gate declaration to `rustc_feature/src/active.rs` in the active
1315
`declare_features` block:
1416

1517
```rust,ignore

src/doc/rustc-dev-guide/src/implementing_new_features.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ a new unstable feature:
123123
2. Pick a name for the feature gate (for RFCs, use the name
124124
in the RFC).
125125

126-
3. Add a feature gate declaration to `rustc_feature/src/active.rs`
127-
in the active `declare_features` block. See [here][add-feature-gate] for
128-
detailed instructions.
126+
3. Add a feature gate declaration to `rustc_feature/src/active.rs` in the active
127+
`declare_features` block, and add the feature gate keyword to
128+
`rustc_span/src/symbol.rs`. See [here][add-feature-gate] for detailed instructions.
129129

130130
4. Prevent usage of the new feature unless the feature gate is set.
131131
You can check it in most places in the compiler using the

0 commit comments

Comments
 (0)