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 and the constants in std::f32 and std::f64 (but not the undeprecated consts submodule) as fully deprecated.

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

This comment has been minimized.

@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
Zalathar added a commit to Zalathar/rust that referenced this pull request Oct 9, 2025
…mdev

give a better example why `std` modules named like primitives are needed

A small update to the `std` `lib.rs` introduction to replace mentions of `std::i32` (never needed) with `std::char` (sometimes needed).
Related to rust-lang#146882.
Zalathar added a commit to Zalathar/rust that referenced this pull request Oct 9, 2025
…mdev

give a better example why `std` modules named like primitives are needed

A small update to the `std` `lib.rs` introduction to replace mentions of `std::i32` (never needed) with `std::char` (sometimes needed).
Related to rust-lang#146882.
rust-timer added a commit that referenced this pull request Oct 9, 2025
Rollup merge of #147373 - cyrgani:cyrgani-patch-1, r=ibraheemdev

give a better example why `std` modules named like primitives are needed

A small update to the `std` `lib.rs` introduction to replace mentions of `std::i32` (never needed) with `std::char` (sometimes needed).
Related to #146882.
github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request Oct 10, 2025
…mdev

give a better example why `std` modules named like primitives are needed

A small update to the `std` `lib.rs` introduction to replace mentions of `std::i32` (never needed) with `std::char` (sometimes needed).
Related to rust-lang#146882.
RalfJung pushed a commit to RalfJung/miri that referenced this pull request Oct 13, 2025
give a better example why `std` modules named like primitives are needed

A small update to the `std` `lib.rs` introduction to replace mentions of `std::i32` (never needed) with `std::char` (sometimes needed).
Related to rust-lang/rust#146882.
@rust-rfcbot rust-rfcbot added final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. and removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. labels Oct 15, 2025
@rust-rfcbot
Copy link
Collaborator

🔔 This is now entering its final comment period, as per the review above. 🔔

@RalfJung
Copy link
Member

marking the std::u8 etc. modules as fully deprecated and as #[doc(hidden)].

It seems the doc(hidden) part got removed; please also update the PR description since it will permanently become part pf the git history.

@rust-rfcbot rust-rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Oct 25, 2025
@rust-rfcbot
Copy link
Collaborator

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

This will be merged soon.

@matthiasg
Copy link

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.

This might be a general area of improvement of Rust Docs. Move older deprecated modules/structs/etc into a hidden state (if anything was deprecated an automatic mention at top to 'optionally include them'), search would not be affected of course.

When I say 'older' I literally mean code deprecated eg 12 months ago based on publishing date.

tgross35 pushed a commit to tgross35/rust that referenced this pull request Dec 3, 2025
@rust-cloud-vms rust-cloud-vms bot force-pushed the deprecate-legacy-int-mods branch from 7fa9c6a to d7984d2 Compare December 25, 2025 12:51
@rustbot
Copy link
Collaborator

rustbot commented Dec 25, 2025

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rust-log-analyzer

This comment has been minimized.

@rust-cloud-vms rust-cloud-vms bot force-pushed the deprecate-legacy-int-mods branch from d7984d2 to 6ae2c73 Compare December 25, 2025 13:08
@rustbot rustbot added the A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) label Dec 25, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-cloud-vms rust-cloud-vms bot force-pushed the deprecate-legacy-int-mods branch 2 times, most recently from aab59e6 to ddd855f Compare December 25, 2025 14:02
@rustbot
Copy link
Collaborator

rustbot commented Dec 25, 2025

The Miri subtree was changed

cc @rust-lang/miri

@rust-log-analyzer

This comment has been minimized.

@rust-cloud-vms rust-cloud-vms bot force-pushed the deprecate-legacy-int-mods branch from ddd855f to 5ecd92b Compare December 25, 2025 14:44
@rustbot
Copy link
Collaborator

rustbot commented Dec 25, 2025

Some changes occurred in src/tools/rustfmt

cc @rust-lang/rustfmt

@rustbot rustbot added the T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. label Dec 25, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-cloud-vms rust-cloud-vms bot force-pushed the deprecate-legacy-int-mods branch from 5ecd92b to 6002eba Compare December 25, 2025 18:38
@rustbot
Copy link
Collaborator

rustbot commented Dec 25, 2025

stdarch is developed in its own repository. If possible, consider making this change to rust-lang/stdarch instead.

cc @Amanieu, @folkertdev, @sayantn

@rust-log-analyzer

This comment has been minimized.

@rust-cloud-vms rust-cloud-vms bot force-pushed the deprecate-legacy-int-mods branch from 6002eba to e7e27f5 Compare December 25, 2025 20:58
@rust-log-analyzer

This comment has been minimized.

@rust-cloud-vms rust-cloud-vms bot force-pushed the deprecate-legacy-int-mods branch from e7e27f5 to bde8767 Compare December 25, 2025 22:08
@rustbot
Copy link
Collaborator

rustbot commented Dec 25, 2025

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@rustbot rustbot added the T-clippy Relevant to the Clippy team. label Dec 25, 2025
macro_rules! fixed_atan2_cases{
($float_type:ident) => {{
use std::$float_type::consts::{PI, FRAC_PI_2, FRAC_PI_4};
use $float_type::{INFINITY, NEG_INFINITY};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does useing these no longer work? I'd prefer not to make the tests below more verbose with all these long paths.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, there is no good way for this. I added two constants instead for now, but I'm not happy with that solution either.

@rust-cloud-vms rust-cloud-vms bot force-pushed the deprecate-legacy-int-mods branch from bde8767 to 1767156 Compare December 26, 2025 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. to-announce Announce this issue on triage meeting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tracking issue for RFC 2700: numeric constants as associated consts

7 participants