Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions library/core/src/mem/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,32 @@
//! Basic functions for dealing with memory.
//! Basic functions for dealing with memory, values, and types.
//!
//! This module contains functions for querying the size and alignment of
//! types, initializing and manipulating memory.
//! The contents of this module can be seen as belonging to a few families:
//!
//! * [`drop`], [`replace`], [`swap`], and [`take`]
//! are safe functions for moving values in particular ways.
//! They are useful in everyday Rust code.
//!
//! * [`size_of`], [`size_of_val`], [`align_of`], [`align_of_val`], and [`offset_of`]
//! give information about the representation of values in memory.
//!
//! * [`discriminant`]
//! allows comparing the variants of [`enum`] values while ignoring their fields.
//!
//! * [`forget`] and [`ManuallyDrop`]
//! prevent destructors from running, which is used in certain kinds of ownership transfer.
//! [`needs_drop`]
//! tells you whether a type’s destructor even does anything.
//!
//! * [`transmute`], [`transmute_copy`], and [`MaybeUninit`]
//! convert and construct values in [`unsafe`] ways.
//!
//! See also the [`alloc`] and [`ptr`] modules for more primitive operations on memory.
//!
// core::alloc exists but doesn’t contain all the items we want to discuss
//! [`alloc`]: ../../std/alloc/index.html
//! [`enum`]: ../../std/keyword.enum.html
//! [`ptr`]: crate::ptr
//! [`unsafe`]: ../../std/keyword.unsafe.html
#![stable(feature = "rust1", since = "1.0.0")]

Expand Down
12 changes: 0 additions & 12 deletions tests/ui/binding/match-naked-record.rs

This file was deleted.

10 changes: 0 additions & 10 deletions tests/ui/issues/issue-4830.rs

This file was deleted.

38 changes: 0 additions & 38 deletions tests/ui/issues/issue-5192.rs

This file was deleted.

7 changes: 0 additions & 7 deletions tests/ui/macros/unreachable.rs

This file was deleted.

8 changes: 0 additions & 8 deletions tests/ui/moves/array-copy-move.rs

This file was deleted.

Loading