Add overview documentation for std::mem.#153793
Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom Mar 16, 2026
Merged
Add overview documentation for std::mem.#153793rust-bors[bot] merged 1 commit intorust-lang:mainfrom
std::mem.#153793rust-bors[bot] merged 1 commit intorust-lang:mainfrom
Conversation
Collaborator
|
rustbot has assigned @Mark-Simulacrum. Use Why was this reviewer chosen?The reviewer was selected based on:
|
scottmcm
reviewed
Mar 12, 2026
I heard that `std::mem` sounds scary to some people, and how it’s described — “Basic functions for dealing with memory” — sounds even to me like something that should be avoided, not even because it would be unsafe, but because it is too low-level. Let’s fix that by telling people about what they can actually find in the module, without having to read all the individual item descriptions.
scottmcm
approved these changes
Mar 15, 2026
Member
|
Thanks! With @bors r+ rollup |
Contributor
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Mar 15, 2026
Add overview documentation for `std::mem`. I heard that `std::mem` sounds scary to some people, and how it’s described — “Basic functions for dealing with memory” — sounds even to me like something that should be avoided, not even because it would be unsafe, but because it is too low-level. Let’s fix that by telling people about what they can actually find in the module, without having to read all the individual item descriptions. The exact contents of the list are, of course, highly debatable, and I chose not to include any of the unstable or deprecated items, nor to include `Discriminant` as well as `discriminant`. I’m also not particularly happy with the wording of the introductory paragraph.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Mar 15, 2026
Add overview documentation for `std::mem`. I heard that `std::mem` sounds scary to some people, and how it’s described — “Basic functions for dealing with memory” — sounds even to me like something that should be avoided, not even because it would be unsafe, but because it is too low-level. Let’s fix that by telling people about what they can actually find in the module, without having to read all the individual item descriptions. The exact contents of the list are, of course, highly debatable, and I chose not to include any of the unstable or deprecated items, nor to include `Discriminant` as well as `discriminant`. I’m also not particularly happy with the wording of the introductory paragraph.
rust-bors bot
pushed a commit
that referenced
this pull request
Mar 15, 2026
Rollup of 6 pull requests Successful merges: - #153639 (Remove `QueryInfo`.) - #153570 (MaybeUninit: mention common mistakes in assume_init docs; link to validity invariant docs) - #153793 (Add overview documentation for `std::mem`.) - #153884 (test `classify-runtime-const` for `f16`) - #153922 (rustc_mir_build only depends on rustc_lint_defs, not rustc_lint) - #153928 (remove several redundant tests)
Zalathar
added a commit
to Zalathar/rust
that referenced
this pull request
Mar 16, 2026
Add overview documentation for `std::mem`. I heard that `std::mem` sounds scary to some people, and how it’s described — “Basic functions for dealing with memory” — sounds even to me like something that should be avoided, not even because it would be unsafe, but because it is too low-level. Let’s fix that by telling people about what they can actually find in the module, without having to read all the individual item descriptions. The exact contents of the list are, of course, highly debatable, and I chose not to include any of the unstable or deprecated items, nor to include `Discriminant` as well as `discriminant`. I’m also not particularly happy with the wording of the introductory paragraph.
rust-bors bot
pushed a commit
that referenced
this pull request
Mar 16, 2026
Rollup of 7 pull requests Successful merges: - #153639 (Remove `QueryInfo`.) - #153570 (MaybeUninit: mention common mistakes in assume_init docs; link to validity invariant docs) - #153793 (Add overview documentation for `std::mem`.) - #153922 (rustc_mir_build only depends on rustc_lint_defs, not rustc_lint) - #153923 (run_make_support: Print the command and output even if it succeeds) - #153925 (Provide better suggestions for inference errors on `.collect()?`) - #153928 (remove several redundant tests)
rust-bors bot
pushed a commit
that referenced
this pull request
Mar 16, 2026
Rollup of 8 pull requests Successful merges: - #153639 (Remove `QueryInfo`.) - #153570 (MaybeUninit: mention common mistakes in assume_init docs; link to validity invariant docs) - #153724 (Show named lifetime in closure upvar diagnostics) - #153793 (Add overview documentation for `std::mem`.) - #153922 (rustc_mir_build only depends on rustc_lint_defs, not rustc_lint) - #153923 (run_make_support: Print the command and output even if it succeeds) - #153925 (Provide better suggestions for inference errors on `.collect()?`) - #153928 (remove several redundant tests)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I heard that
std::memsounds scary to some people, and how it’s described — “Basic functions for dealing with memory” — sounds even to me like something that should be avoided, not even because it would be unsafe, but because it is too low-level.Let’s fix that by telling people about what they can actually find in the module, without having to read all the individual item descriptions.
The exact contents of the list are, of course, highly debatable, and I chose not to include any of the unstable or deprecated items, nor to include
Discriminantas well asdiscriminant. I’m also not particularly happy with the wording of the introductory paragraph.