From 860e436d0e1dc1b3cdb403768ab0667628bba732 Mon Sep 17 00:00:00 2001 From: Wesley Wiser Date: Sun, 22 Oct 2017 11:53:29 -0400 Subject: [PATCH 1/2] Document the `size_of_val` instrinsic --- src/libcore/intrinsics.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs index bc82f0230e5b4..2d6b5b832c534 100644 --- a/src/libcore/intrinsics.rs +++ b/src/libcore/intrinsics.rs @@ -676,6 +676,10 @@ extern "rust-intrinsic" { pub fn min_align_of() -> usize; pub fn pref_align_of() -> usize; + /// The size of the referenced value in bytes. + /// + /// The stabilized version of this intrinsic is + /// [`std::mem::size_of_val`](../../std/mem/fn.size_of_val.html). pub fn size_of_val(_: &T) -> usize; pub fn min_align_of_val(_: &T) -> usize; From 3bc97bfe9a1082693488105cb540fdc10d1d38e1 Mon Sep 17 00:00:00 2001 From: Wesley Wiser Date: Sun, 22 Oct 2017 20:15:56 -0400 Subject: [PATCH 2/2] Add link to stable version of `needs_drop` intrinsic --- src/libcore/intrinsics.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs index 2d6b5b832c534..ddad67273dc77 100644 --- a/src/libcore/intrinsics.rs +++ b/src/libcore/intrinsics.rs @@ -925,6 +925,9 @@ extern "rust-intrinsic" { /// /// If the actual type neither requires drop glue nor implements /// `Copy`, then may return `true` or `false`. + /// + /// The stabilized version of this intrinsic is + /// [`std::mem::needs_drop`](../../std/mem/fn.needs_drop.html). pub fn needs_drop() -> bool; /// Calculates the offset from a pointer.