about summary refs log tree commit diff
path: root/library/std/src/prelude/common.rs
AgeCommit message (Collapse)AuthorLines
2025-02-11Remove the common prelude moduleEric Huss-120/+0
This fixes the issues described in https://github.com/rust-lang/rust/issues/136102. Primarily, this resolves some issues with how the documentation for the prelude is generated: - It avoids showing "unstable" for macros in the prelude that are actually stable. - Avoids duplication of some pages due to the previous lack of `doc(no_inline)`. - Makes the different edition preludes consistent, and sets a pattern that can be used by future editions. We may need to rearrange these modules in the future if we decide to remove anything from the prelude again. If we do, I think we should look into a different solution that avoids the documentation problems.
2025-01-08update cfg(bootstrap)Pietro Albini-2/+1
2025-01-08update version placeholdersPietro Albini-1/+1
2024-12-13Stabilize async closuresMichael Goulet-1/+2
2024-11-04Add AsyncFn* to to the prelude in all editionsMichael Goulet-0/+3
2024-07-17Avoid comments that describe multiple `use` items.Nicholas Nethercote-0/+3
There are some comments describing multiple subsequent `use` items. When the big `use` reformatting happens some of these `use` items will be reordered, possibly moving them away from the comment. With this additional level of formatting it's not really feasible to have comments of this type. This commit removes them in various ways: - merging separate `use` items when appropriate; - inserting blank lines between the comment and the first `use` item; - outright deletion (for comments that are relatively low-value); - adding a separate "top-level" comment. We also entirely skip formatting for four library files that contain nothing but `pub use` re-exports, where reordering would be painful.
2024-06-11replace version placeholderPietro Albini-1/+1
2024-05-13Add `size_of`, `size_of_val`, `align_of`, and `align_of_val` to the preludeJosh Triplett-0/+3
Many, many projects use `size_of` to get the size of a type. However, it's also often equally easy to hardcode a size (e.g. `8` instead of `size_of::<u64>()`). Minimizing friction in the use of `size_of` helps ensure that people use it and make code more self-documenting. The name `size_of` is unambiguous: the name alone, without any prefix or path, is self-explanatory and unmistakeable for any other functionality. Adding it to the prelude cannot produce any name conflicts, as any local definition will silently shadow the one from the prelude. Thus, we don't need to wait for a new edition prelude to add it. Add `size_of_val`, `align_of`, and `align_of_val` as well, with similar justification: widely useful, self-explanatory, unmistakeable for anything else, won't produce conflicts.
2024-05-01Step bootstrap cfgsMark Rousskov-1/+0
2024-03-22Remove RustcEncodable/Decodable from 2024 preludeJacob Pratt-0/+112