about summary refs log tree commit diff
path: root/library/std/src/prelude/mod.rs
AgeCommit message (Collapse)AuthorLines
2025-02-24span: add a "future" editionDavid Wood-0/+15
It's hard to implement edition migrations without having a perma-unstable "future" edition to target.
2025-02-11Remove the common prelude moduleEric Huss-11/+3
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-14remove Rustc{En,De}codable from library and compilerRalf Jung-9/+0
2025-01-14make rustc_encodable_decodable feature properly unstableRalf Jung-2/+1
2025-01-08update version placeholdersPietro Albini-2/+2
2024-12-13Reword prelude for AsyncFn stabilizationMichael Goulet-2/+3
2024-12-11Stabilize the Rust 2024 preludeEric Huss-3/+13
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-05-13Add `size_of`, `size_of_val`, `align_of`, and `align_of_val` to the preludeJosh Triplett-0/+4
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-03-22Remove RustcEncodable/Decodable from 2024 preludeJacob Pratt-4/+22
2024-02-18Add `Future` and `IntoFuture` to the 2024 preludeNilstrieb-3/+3
Implements RFC 3509.
2023-04-12remove some unneeded importsKaDiWa-5/+1
2022-04-02Create 2024 editionJacob Pratt-0/+14
2021-06-14Stabilize {std, core}::prelude::rust_*.Mara Bos-9/+23
2021-05-25Add tracking issue for edition-specific preludes.Mara Bos-7/+7
2021-03-31Rollup merge of #80720 - steffahn:prettify_prelude_imports, r=camelid,jyn514Dylan DPC-32/+32
Make documentation of which items the prelude exports more readable. I recently figured out that rustdoc allows link inside of inline code blocks as long as they’re delimited with `<code> </code>` instead of `` ` ` ``. I think this applies nicely in the listing of prelude exports [in the docs](https://doc.rust-lang.org/std/prelude/index.html). There, currently unformatted `::` and `{ , }` is used in order to mimick import syntax while attatching links to individual identifiers. ## Rendered Comparison ### Currently (light) ![Screenshot_20210105_155801](https://user-images.githubusercontent.com/3986214/103661510-1a87be80-4f6f-11eb-8360-1dfb23f732e8.png) ### After this PR (light) ![Screenshot_20210105_155811](https://user-images.githubusercontent.com/3986214/103661533-1f4c7280-4f6f-11eb-89d4-874793937824.png) ### Currently (dark) ![Screenshot_20210105_155824](https://user-images.githubusercontent.com/3986214/103661571-2a9f9e00-4f6f-11eb-95f9-e291b5570b41.png) ### After this PR (dark) ![Screenshot_20210105_155836](https://user-images.githubusercontent.com/3986214/103661592-2ffce880-4f6f-11eb-977a-82afcb07d331.png) ### Currently (ayu) ![Screenshot_20210105_155917](https://user-images.githubusercontent.com/3986214/103661619-39865080-4f6f-11eb-9ca1-9045a107cddd.png) ### After this PR (ayu) ![Screenshot_20210105_155923](https://user-images.githubusercontent.com/3986214/103661652-3db26e00-4f6f-11eb-82b7-378e38f0c41f.png) _Edit:_ I just noticed, the “current” screenshots are from stable, so there are a few more differences in the pictures than the ones from just this PR.
2021-03-29Change back prelude headlineFrank Steffahn-1/+1
2021-02-25Use intra-doc links.Mara-3/+3
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2021-02-25Add {core,std}::prelude::{rust_2015,rust_2018,rust_2021}.Mara Bos-0/+34
rust_2015 and rust_2018 are just re-exports of v1. rust_2021 is a module that for now just re-exports everything from v1, such that we can add more things later.
2021-01-21Make documentation of which items the prelude exports more readably.Frank Steffahn-33/+33
2021-01-05Use heading for `std::prelude` and not `io::prelude`Camelid-1/+1
The heading style for `std::prelude` is to be consistent with the headings for `std` and `core`: `# The Rust Standard Library` and `# The Rust Core Library`, respectively.
2021-01-05Use lowercase for prelude itemsCamelid-12/+12
2020-12-18Use consistent punctuation for 'Prelude contents' docsCamelid-14/+14
2020-12-17Edit formatting in Rust Prelude docspierwill-13/+12
Use consistent punctuation and capitalization in the list of things re-exported in the prelude. Also adds a (possibly missing) word.
2020-09-02Fix incorrect link in preludeJoshua Nelson-1/+1
2020-09-02Convert many files to intra-doc linksJoshua Nelson-1/+1
- Use intra-doc links for `std::io` in `std::fs` - Use intra-doc links for File::read in unix/ext/fs.rs - Remove explicit intra-doc links for `true` in `net/addr.rs` - Use intra-doc links in alloc/src/sync.rs - Use intra-doc links in src/ascii.rs - Switch to intra-doc links in alloc/rc.rs - Use intra-doc links in core/pin.rs - Use intra-doc links in std/prelude - Use shorter links in `std/fs.rs` `io` is already in scope.
2020-08-11Move the std::vec link back to a path-based link to make it compile with ↵Alexis Bourget-1/+1
--stage 0
2020-08-10Move to doc links inside the preludeAlexis Bourget-59/+26
2020-07-27mv std libs to library/mark-0/+120