From d22815f206712fe9b3604f249487d29e55f30aac Mon Sep 17 00:00:00 2001 From: reddevilmidzy Date: Tue, 3 Feb 2026 17:06:53 +0900 Subject: [PATCH] Add cross-links between feature gate docs --- src/feature-gate-check.md | 4 ++++ src/feature-gates.md | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/feature-gate-check.md b/src/feature-gate-check.md index 591231c022..c5a499f570 100644 --- a/src/feature-gate-check.md +++ b/src/feature-gate-check.md @@ -1,5 +1,8 @@ # Feature Gate Checking +For the how-to steps to add, remove, rename, or stabilize feature gates, +see [Feature gates][feature-gates]. + Feature gates prevent usage of unstable language and library features without a nightly-only `#![feature(...)]` opt-in. This chapter documents the implementation of feature gating: where gates are defined, how they are enabled, and how usage @@ -138,3 +141,4 @@ Diagnostic helpers are located in [`rustc_session/src/parse.rs`]. [`rustc_attr_parsing/src/attributes/cfg.rs`]: https://github.com/rust-lang/rust/blob/HEAD/compiler/rustc_attr_parsing/src/attributes/cfg.rs [`rustc_feature::find_gated_cfg`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_feature/fn.find_gated_cfg.html [`rustc_span/src/lib.rs`]: https://github.com/rust-lang/rust/blob/HEAD/compiler/rustc_span/src/lib.rs +[feature-gates]: ./feature-gates.md diff --git a/src/feature-gates.md b/src/feature-gates.md index d2a5173607..76bf111fe7 100644 --- a/src/feature-gates.md +++ b/src/feature-gates.md @@ -3,9 +3,13 @@ This chapter is intended to provide basic help for adding, removing, and modifying feature gates. +For how rustc enforces and checks feature gates in the compiler pipeline, +see [Feature Gate Checking][feature-gate-check]. + Note that this is specific to *language* feature gates; *library* feature gates use [a different mechanism][libs-gate]. +[feature-gate-check]: ./feature-gate-check.md [libs-gate]: ./stability.md ## Adding a feature gate