about summary refs log tree commit diff
path: root/src/libstd/ptr.rs
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2014-02-20 14:58:46 +0100
committerFelix S. Klock II <pnkfelix@pnkfx.org>2014-02-20 14:58:46 +0100
commite2f99b93cd0f9bdbaf126ce3eb5b9a8f2be354f4 (patch)
tree2fc4617c6830d8bdc0cdc070bbf52245037c2a42 /src/libstd/ptr.rs
parent882c25fa2ded21f02e26d00045ae72457b08724c (diff)
downloadrust-e2f99b93cd0f9bdbaf126ce3eb5b9a8f2be354f4.tar.gz
rust-e2f99b93cd0f9bdbaf126ce3eb5b9a8f2be354f4.zip
ptr::RawPtr, spell out units used for the `offset` argument.
spell out units used for the `offset` argument, so that callers do not
try to scale to byte units themselves.
Diffstat (limited to 'src/libstd/ptr.rs')
-rw-r--r--src/libstd/ptr.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libstd/ptr.rs b/src/libstd/ptr.rs
index 037984d9e7f..193e9ea7052 100644
--- a/src/libstd/ptr.rs
+++ b/src/libstd/ptr.rs
@@ -213,7 +213,8 @@ pub trait RawPtr<T> {
     /// be pointing to invalid memory.
     unsafe fn to_option(&self) -> Option<&T>;
     /// Calculates the offset from a pointer. The offset *must* be in-bounds of
-    /// the object, or one-byte-past-the-end.
+    /// the object, or one-byte-past-the-end.  `count` is in units of T; e.g. a
+    /// `count` of 3 represents a pointer offset of `3 * sizeof::<T>()` bytes.
     unsafe fn offset(self, count: int) -> Self;
 }