Add #[doc(alias = "phi")] for float GOLDEN_RATIO constants#156830
Merged
Conversation
Collaborator
|
rustbot has assigned @Mark-Simulacrum. Use Why was this reviewer chosen?The reviewer was selected based on:
|
Contributor
|
@bors r+ rollup |
Contributor
jhpratt
added a commit
to jhpratt/rust
that referenced
this pull request
May 23, 2026
Add `#[doc(alias = "phi")]` for float `GOLDEN_RATIO` constants - Adds "phi" doc alias for `f16`, `f32`, `f64`, and `f128` I knew this constant was stabilized but I couldn't remember what it was called. Searching "phi" in the docs only surfaces the π constant, `is_ascii_graphic`, and `spin_loop_hint` methods. This alias would make it much easier to find. https://doc.rust-lang.org/nightly/std/?search=phi
rust-bors Bot
pushed a commit
that referenced
this pull request
May 24, 2026
…uwer Rollup of 6 pull requests Successful merges: - #156769 (Use print instead of po in debuginfo path test) - #156784 (Fix reborrow_info early return skipping field validation) - #156827 (float_literal_f32_fallback: Don't suggest invalid code) - #156828 (Add unstable Share trait) - #156830 (Add `#[doc(alias = "phi")]` for float `GOLDEN_RATIO` constants) - #156860 (Fix Pieter-Louis Schoeman mailmap entry)
rust-timer
added a commit
that referenced
this pull request
May 24, 2026
Rollup merge of #156830 - okaneco:phi_doc_alias, r=SimonSapin Add `#[doc(alias = "phi")]` for float `GOLDEN_RATIO` constants - Adds "phi" doc alias for `f16`, `f32`, `f64`, and `f128` I knew this constant was stabilized but I couldn't remember what it was called. Searching "phi" in the docs only surfaces the π constant, `is_ascii_graphic`, and `spin_loop_hint` methods. This alias would make it much easier to find. https://doc.rust-lang.org/nightly/std/?search=phi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
f16,f32,f64, andf128I knew this constant was stabilized but I couldn't remember what it was called.
Searching "phi" in the docs only surfaces the π constant,
is_ascii_graphic, andspin_loop_hintmethods. This alias would make it much easier to find.https://doc.rust-lang.org/nightly/std/?search=phi