Skip to content

[slice] Document slice DSTs, including size guarantees #117474

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

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Update primitive_docs.rs
  • Loading branch information
joshlf authored Nov 2, 2023
commit 49eecf249f3b4981d22db5205f814deefcb5dfb3
4 changes: 2 additions & 2 deletions library/core/src/primitive_docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ mod prim_array {}
/// Slices can be used to construct "slice-based dynamically-sized types", also
/// known as "slice DSTs" or "custom DSTs":
///
/// ```rust
/// ```
/// struct SliceDst {
/// a: u8,
/// b: u16,
Expand All @@ -885,7 +885,7 @@ mod prim_array {}
/// References to slice DSTs encode the number of elements in the trailing slice
/// field:
///
/// ```rust
/// ```
/// # struct SliceDst { a: u8, b: u16, c: [u32] }
/// let pointer_size = std::mem::size_of::<&u8>();
/// assert_eq!(2 * pointer_size, std::mem::size_of::<&SliceDst>());
Expand Down