Add symbol-addition to the how-to for new features (#1457)

Co-authored-by: Yuki Okushi <jtitor@2k36.org>
This commit is contained in:
Devin Jeanpierre 2022-09-11 14:19:13 -07:00 committed by GitHub
parent 48776510af
commit 01c550ef63
2 changed files with 6 additions and 4 deletions

View File

@ -9,7 +9,9 @@ modifying feature gates.
See ["Stability in code"] for help with adding a new feature; this section just
covers how to add the feature gate *declaration*.
Add a feature gate declaration to `rustc_feature/src/active.rs` in the active
First, add the feature name to `rustc_span/src/symbol.rs` in the `Symbols {...}` block.
Then, add a feature gate declaration to `rustc_feature/src/active.rs` in the active
`declare_features` block:
```rust,ignore

View File

@ -123,9 +123,9 @@ a new unstable feature:
2. Pick a name for the feature gate (for RFCs, use the name
in the RFC).
3. Add a feature gate declaration to `rustc_feature/src/active.rs`
in the active `declare_features` block. See [here][add-feature-gate] for
detailed instructions.
3. Add a feature gate declaration to `rustc_feature/src/active.rs` in the active
`declare_features` block, and add the feature gate keyword to
`rustc_span/src/symbol.rs`. See [here][add-feature-gate] for detailed instructions.
4. Prevent usage of the new feature unless the feature gate is set.
You can check it in most places in the compiler using the