Skip to content

Commit a77f95f

Browse files
committed
std: Explain range follows standard half-open range in offset
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
1 parent ae8ab87 commit a77f95f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/core/src/ptr/const_ptr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ impl<T: ?Sized> *const T {
386386
/// * If the computed offset is non-zero, then `self` must be [derived from][crate::ptr#provenance] a pointer to some
387387
/// [allocated object], and the entire memory range between `self` and the result must be in
388388
/// bounds of that allocated object. In particular, this range must not "wrap around" the edge
389-
/// of the address space.
389+
/// of the address space. Note that when we refer to "range", we follow Rust's standard half-open range (`a..b`) semantics.
390390
///
391391
/// Allocated objects can never be larger than `isize::MAX` bytes, so if the computed offset
392392
/// stays in bounds of the allocated object, it is guaranteed to satisfy the first requirement.

0 commit comments

Comments
 (0)