Skip to content

Conversation

cyrgani
Copy link
Contributor

@cyrgani cyrgani commented Sep 22, 2025

This PR implements the last step of #68490: marking the std::u8 etc. modules as fully deprecated and as #[doc(hidden)].
I did not mark the constants in std::f32 and std::f64 as hidden because the module also contains the undeprecated consts submodule.

Revival of #107587 (cc @tgross35).

Closes: #68490

r? libs-api

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Sep 22, 2025
@cyrgani cyrgani added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. and removed T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Sep 22, 2025
@rust-log-analyzer

This comment has been minimized.

@BurntSushi
Copy link
Member

I'm still kind of meh on these deprecations personally, but we should probably finish what was started.

With that said, I'm strongly opposed to applying #[doc(hidden)] to deprecated items. I'm not sure why you're doing that here. It seems like an obviously bad user experience that only serves to gaslight users. Imagine reading old code, wondering what a function does and then going to look it up in the docs only to find that... it isn't there?

Once the #[doc(hidden)] attributes are removed, I'd be happy to kick off an FCP.

@cyrgani cyrgani force-pushed the deprecate-legacy-int-mods branch from 438bfa3 to 7fa9c6a Compare September 22, 2025 13:11
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-tools failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[RUSTC-TIMING] build_script_build test:false 0.101
[RUSTC-TIMING] cc test:false 0.663
   Compiling compiler_builtins v0.1.160 (/checkout/library/compiler-builtins/compiler-builtins)
[RUSTC-TIMING] build_script_build test:false 0.237
error: use of deprecated constant `core::f64::EPSILON`: replaced by the `EPSILON` associated constant on `f64`
  --> library/compiler-builtins/compiler-builtins/src/math/../../../libm/src/math/rem_pio2f.rs:21:31
   |
21 | const TOINT: f64 = 1.5 / f64::EPSILON;
   |                               ^^^^^^^
   |
   = note: `-D deprecated` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(deprecated)]`

@cyrgani
Copy link
Contributor Author

cyrgani commented Sep 22, 2025

I've removed the #[doc(hidden] attributes.
Regarding why I added them, it is mostly the feeling that having twelve deprecated modules right on the front page of the std documentation is not a good user experience either.
Also, people who would search the docs for core::u8::MAX would still get u8::MAX as their first search result to find out what the constant means.

@cyrgani cyrgani changed the title fully deprecate and hide the legacy integral modules fully deprecate the legacy integral modules Sep 22, 2025
@BurntSushi
Copy link
Member

Regarding why I added them, it is mostly the feeling that having twelve deprecated modules right on the front page of the std documentation is not a good user experience either.

Perhaps! But the solution is definitely not to completely hide them.

Also, people who would search the docs for core::u8::MAX would still get u8::MAX as their first search result to find out what the constant means.

Sure, same thing applies here. I don't know anything about how rustdoc's search result ranking works, but it seems reasonable that it could take deprecation status into account.

@BurntSushi
Copy link
Member

@rfcbot merge

@rust-rfcbot
Copy link
Collaborator

rust-rfcbot commented Sep 22, 2025

Team member @BurntSushi has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@rust-rfcbot rust-rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels Sep 22, 2025
tgross35 pushed a commit to rust-lang/compiler-builtins that referenced this pull request Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tracking issue for RFC 2700: numeric constants as associated consts
5 participants