about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2017-09-23 00:29:10 -0400
committerGitHub <noreply@github.com>2017-09-23 00:29:10 -0400
commit04eb88c987be232e9eecba7c2d336e10b614dfac (patch)
treee49c592ceb990cb5772e2d9856bdf57b75703997 /src/libstd
parent7d75781cc28df44be57031e4d733b05b1e2f9dc2 (diff)
parent548686ff12322f948652ee6523074b2ce6d2bb06 (diff)
downloadrust-04eb88c987be232e9eecba7c2d336e10b614dfac.tar.gz
rust-04eb88c987be232e9eecba7c2d336e10b614dfac.zip
Rollup merge of #44648 - Havvy:doc-size_of, r=dtolnay
Expand size_of docs

This PR does 3 things.

1. Adds a description of what pointer size means to the primitive pages for usize and isize.
2. Says the general size of things is not stable from compiler to compiler.
3. Adds a table of sizes of things that we do guarantee. As this is the first table in the libstd docs, I've included a picture of how that looks.

![](https://i.imgur.com/YZ6IChH.png?1)
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/primitive_docs.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libstd/primitive_docs.rs b/src/libstd/primitive_docs.rs
index 76ef36cc9a7..1edb35d8fe7 100644
--- a/src/libstd/primitive_docs.rs
+++ b/src/libstd/primitive_docs.rs
@@ -710,6 +710,10 @@ mod prim_u128 { }
 //
 /// The pointer-sized signed integer type.
 ///
+/// The size of this primitive is how many bytes it takes to reference any
+/// location in memory. For example, on a 32 bit target, this is 4 bytes
+/// and on a 64 bit target, this is 8 bytes.
+///
 /// *[See also the `std::isize` module](isize/index.html).*
 ///
 /// However, please note that examples are shared between primitive integer
@@ -722,6 +726,10 @@ mod prim_isize { }
 //
 /// The pointer-sized unsigned integer type.
 ///
+/// The size of this primitive is how many bytes it takes to reference any
+/// location in memory. For example, on a 32 bit target, this is 4 bytes
+/// and on a 64 bit target, this is 8 bytes.
+///
 /// *[See also the `std::usize` module](usize/index.html).*
 ///
 /// However, please note that examples are shared between primitive integer