Skip to content

Document path stability of f64::abs in no std crates #139066

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
lopopolo opened this issue Mar 28, 2025 · 2 comments
Open

Document path stability of f64::abs in no std crates #139066

lopopolo opened this issue Mar 28, 2025 · 2 comments
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools A-stability Area: `#[stable]`, `#[unstable]` etc. C-enhancement Category: An issue proposing an enhancement or a PR with one. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@lopopolo
Copy link
Contributor

lopopolo commented Mar 28, 2025

I tried this code:

#![no_std]

pub fn xxx() {
    f64::abs(1.0);
}

In Rust older than 1.84.

I expected to see this happen: successful compilation since f64::abs is documented to be available since Rust 1.0.

Instead, this happened: compilation failure since f64::abs in no std programs wasn't stabilized until Rust 1.84. This isn't documented anywhere and I had to go issue diving on GitHub.

@RalfJung said the keywords here are documenting path stability vs item stability.

#131304 (comment)

Opening this issue to explore how to document the limited availability of items in no std programs.

In the absence of compiler infrastructure for this, free form text in the prose of the doc comment for the f64 primitive or its abs method would have solved this for me. Maybe in a # Caveats section?

@lopopolo lopopolo added the C-bug Category: This is a bug. label Mar 28, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 28, 2025
@lopopolo lopopolo changed the title Document item stability of f64::abs in no std crates Document path stability of f64::abs in no std crates Mar 28, 2025
@RalfJung
Copy link
Member

Cc @rust-lang/rustdoc @rust-lang/libs-api

@jieyouxu jieyouxu added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools A-stability Area: `#[stable]`, `#[unstable]` etc. C-enhancement Category: An issue proposing an enhancement or a PR with one. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. C-bug Category: This is a bug. labels Mar 28, 2025
@GuillaumeGomez
Copy link
Member

This is indeed pretty bad. I'll try to take a look whenever I have time if no one did until then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools A-stability Area: `#[stable]`, `#[unstable]` etc. C-enhancement Category: An issue proposing an enhancement or a PR with one. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants