-
Notifications
You must be signed in to change notification settings - Fork 13.8k
give a better example why std
modules named like primitives are needed
#147373
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
Conversation
r? @ibraheemdev rustbot has assigned @ibraheemdev. Use |
//! `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). |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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};
.
Thanks. @bors r+ rollup |
…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.
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
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
A small update to the
std
lib.rs
introduction to replace mentions ofstd::i32
(never needed) withstd::char
(sometimes needed).Related to #146882.