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.
This commit is contained in:
parent
882c25fa2d
commit
e2f99b93cd
1 changed files with 2 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue