Skip to content

Conversation

cyrgani
Copy link
Contributor

@cyrgani cyrgani commented Oct 5, 2025

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.

@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 Oct 5, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 5, 2025

r? @ibraheemdev

rustbot has assigned @ibraheemdev.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

//! `char`](primitive::char) that lists all the methods that can be called on
//! characters (very useful), and there is a [page for the module
//! `std::char`] that documents iterator and error types created by these methods
//! (rarely useful).
Copy link
Member

Choose a reason for hiding this comment

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

Would it be better to use “rarely used” to make the expression more neutral?
In module char doc, it presents there are some useful items:

This module is the home of the iterator implementations for the iterators implemented on char, as well as some useful constants and conversion functions that convert various types to char.

And would this be a better way to express it?

//! `char`](primitive::char) that lists all the methods that can be called on
//! characters (very useful), and there is a [page for the module
//! `std::char`] that documents utility types, constants, and conversion functions
//! (rarely used).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would prefer not mentioning the constants and conversion functions here, since they all already exist on the primitive type char itself and do not need to be used anymore, just as it is with std::i32::{MIN, MAX};.

@ibraheemdev
Copy link
Member

Thanks. @bors r+ rollup

@bors
Copy link
Collaborator

bors commented Oct 9, 2025

📌 Commit 0bc6945 has been approved by ibraheemdev

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 9, 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.
bors added a commit that referenced this pull request Oct 9, 2025
Rollup of 7 pull requests

Successful merges:

 - #146568 (Port the implemention of SIMD intrinsics from Miri to const-eval)
 - #147373 (give a better example why `std` modules named like primitives are needed)
 - #147419 (bootstrap: add `Builder::rustc_cmd` that includes the lib path)
 - #147457 (specialize slice::fill to use memset when possible)
 - #147468 (Implement fs api set_times and set_times_nofollow)
 - #147489 (Prefer to use repeat_n over repeat().take())
 - #147506 (compiletest: Isolate public APIs and minimize public surface area)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Oct 9, 2025
Rollup of 12 pull requests

Successful merges:

 - #146568 (Port the implemention of SIMD intrinsics from Miri to const-eval)
 - #147373 (give a better example why `std` modules named like primitives are needed)
 - #147419 (bootstrap: add `Builder::rustc_cmd` that includes the lib path)
 - #147420 (Add diagnostic items for `pub mod consts` of FP types)
 - #147457 (specialize slice::fill to use memset when possible)
 - #147467 (Fix double warnings on `#[no_mangle]`)
 - #147470 (Clarify how to remediate the panic_immediate_abort error)
 - #147480 (Do not invalidate CFG caches in CtfeLimit.)
 - #147481 (format: some small cleanup)
 - #147488 (refactor: Remove `LLVMRustInsertPrivateGlobal` and `define_private_global`)
 - #147489 (Prefer to use repeat_n over repeat().take())
 - #147506 (compiletest: Isolate public APIs and minimize public surface area)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 800bc95 into rust-lang:master Oct 9, 2025
10 checks passed
@rustbot rustbot added this to the 1.92.0 milestone Oct 9, 2025
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.
@cyrgani cyrgani deleted the cyrgani-patch-1 branch October 9, 2025 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants