From 01c550ef63533b2281696050fb306370bed4c5bf Mon Sep 17 00:00:00 2001 From: Devin Jeanpierre Date: Sun, 11 Sep 2022 14:19:13 -0700 Subject: [PATCH] Add symbol-addition to the how-to for new features (#1457) Co-authored-by: Yuki Okushi --- src/feature-gates.md | 4 +++- src/implementing_new_features.md | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/feature-gates.md b/src/feature-gates.md index 229281f2f..9e9a83ea6 100644 --- a/src/feature-gates.md +++ b/src/feature-gates.md @@ -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 diff --git a/src/implementing_new_features.md b/src/implementing_new_features.md index ef6ae6179..36799a2d3 100644 --- a/src/implementing_new_features.md +++ b/src/implementing_new_features.md @@ -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