1.9 KiB
Feature Gates
This chapter is intended to provide basic help for modifying feature gates. See "Stability in code" for help with adding feature gates.
Removing a feature gate
To remove a feature gate, follow these steps:
-
Remove the feature gate declaration in
rustc_feature/src/active.rs. It will look like this:/// description of feature (active, $feature_name, "$version", Some($tracking_issue_number), $edition) -
Add a modified version of the feature gate declaration that you just removed to
rustc_feature/src/removed.rs:/// description of feature (removed, $old_feature_name, "$version", Some($tracking_issue_number), $edition, Some("$why_it_was_removed"))
Renaming a feature gate
To rename a feature gate, follow these steps (the first two are the same steps to follow when removing a feature gate):
-
Remove the old feature gate declaration in
rustc_feature/src/active.rs. It will look like this:/// description of feature (active, $old_feature_name, "$version", Some($tracking_issue_number), $edition) -
Add a modified version of the old feature gate declaration that you just removed to
rustc_feature/src/removed.rs:/// description of feature /// Renamed to `$new_feature_name` (removed, $old_feature_name, "$version", Some($tracking_issue_number), $edition, Some("renamed to `$new_feature_name`")) -
Add a feature gate declaration with the new name to
rustc_feature/src/active.rs. It should look very similar to the old declaration:/// description of feature (active, $new_feature_name, "$version", Some($tracking_issue_number), $edition)