Skip to content

Commit

Permalink
Add symbol-addition to the how-to for new features (#1457)
Browse files Browse the repository at this point in the history
Co-authored-by: Yuki Okushi <jtitor@2k36.org>
  • Loading branch information
ssbr and JohnTitor authored Sep 11, 2022
1 parent a5363fb commit 5d8825e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/feature-gates.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/implementing_new_features.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5d8825e

Please sign in to comment.