From f289ccf207ede543f23d5998bf5ee6a0b793bdf2 Mon Sep 17 00:00:00 2001 From: Daniel Scherzer Date: Mon, 22 Dec 2025 23:49:11 -0800 Subject: [PATCH] `target_features::Stability`: tweak docs of `requires_nightly()` * No method named `allow_toggle()` exists on the type, but based on the documentation of both `requires_nightly()` and `toggle_allowed()` it seems that `toggle_allowed()` is the intended method to mention. * Add `()` to the mention of `in_cfg()` to make it clear that a method is being referred to, and to match the presence of `()` in the mention of `toggle_allowed()`. --- compiler/rustc_target/src/target_features.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_target/src/target_features.rs b/compiler/rustc_target/src/target_features.rs index 35cfeba2bffd..85c473c5abb2 100644 --- a/compiler/rustc_target/src/target_features.rs +++ b/compiler/rustc_target/src/target_features.rs @@ -62,8 +62,8 @@ impl Stability { /// the feature gate to actually be enabled when using a nightly compiler.) /// /// Before calling this, ensure the feature is even permitted for this use: - /// - for `#[target_feature]`/`-Ctarget-feature`, check `allow_toggle()` - /// - for `cfg(target_feature)`, check `in_cfg` + /// - for `#[target_feature]`/`-Ctarget-feature`, check `toggle_allowed()` + /// - for `cfg(target_feature)`, check `in_cfg()` pub fn requires_nightly(&self) -> Option { match *self { Stability::Unstable(nightly_feature) => Some(nightly_feature),