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()`.
This commit is contained in:
Daniel Scherzer 2025-12-22 23:49:11 -08:00 committed by GitHub
parent 5c53093374
commit f289ccf207
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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<Symbol> {
match *self {
Stability::Unstable(nightly_feature) => Some(nightly_feature),