@@ -482,28 +482,28 @@ impl<T: ?Sized> *const T {
482
482
///
483
483
/// This operation itself is always safe, but using the resulting pointer is not.
484
484
///
485
- /// The resulting pointer "remembers" the [allocated object ] that `self` points to
485
+ /// The resulting pointer "remembers" the [allocation ] that `self` points to
486
486
/// (this is called "[Provenance](ptr/index.html#provenance)").
487
- /// The pointer must not be used to read or write other allocated objects .
487
+ /// The pointer must not be used to read or write other allocations .
488
488
///
489
489
/// In other words, `let z = x.wrapping_offset((y as isize) - (x as isize))` does *not* make `z`
490
490
/// the same as `y` even if we assume `T` has size `1` and there is no overflow: `z` is still
491
491
/// attached to the object `x` is attached to, and dereferencing it is Undefined Behavior unless
492
- /// `x` and `y` point into the same allocated object .
492
+ /// `x` and `y` point into the same allocation .
493
493
///
494
494
/// Compared to [`offset`], this method basically delays the requirement of staying within the
495
- /// same allocated object : [`offset`] is immediate Undefined Behavior when crossing object
495
+ /// same allocation : [`offset`] is immediate Undefined Behavior when crossing object
496
496
/// boundaries; `wrapping_offset` produces a pointer but still leads to Undefined Behavior if a
497
497
/// pointer is dereferenced when it is out-of-bounds of the object it is attached to. [`offset`]
498
498
/// can be optimized better and is thus preferable in performance-sensitive code.
499
499
///
500
500
/// The delayed check only considers the value of the pointer that was dereferenced, not the
501
501
/// intermediate values used during the computation of the final result. For example,
502
502
/// `x.wrapping_offset(o).wrapping_offset(o.wrapping_neg())` is always the same as `x`. In other
503
- /// words, leaving the allocated object and then re-entering it later is permitted.
503
+ /// words, leaving the allocation and then re-entering it later is permitted.
504
504
///
505
505
/// [`offset`]: #method.offset
506
- /// [allocated object ]: crate::ptr#allocated-object
506
+ /// [allocation ]: crate::ptr#allocation
507
507
///
508
508
/// # Examples
509
509
///
@@ -616,18 +616,18 @@ impl<T: ?Sized> *const T {
616
616
/// * `self` and `origin` must either
617
617
///
618
618
/// * point to the same address, or
619
- /// * both be [derived from][crate::ptr#provenance] a pointer to the same [allocated object ], and the memory range between
619
+ /// * both be [derived from][crate::ptr#provenance] a pointer to the same [allocation ], and the memory range between
620
620
/// the two pointers must be in bounds of that object. (See below for an example.)
621
621
///
622
622
/// * The distance between the pointers, in bytes, must be an exact multiple
623
623
/// of the size of `T`.
624
624
///
625
625
/// As a consequence, the absolute distance between the pointers, in bytes, computed on
626
626
/// mathematical integers (without "wrapping around"), cannot overflow an `isize`. This is
627
- /// implied by the in-bounds requirement, and the fact that no allocated object can be larger
627
+ /// implied by the in-bounds requirement, and the fact that no allocation can be larger
628
628
/// than `isize::MAX` bytes.
629
629
///
630
- /// The requirement for pointers to be derived from the same allocated object is primarily
630
+ /// The requirement for pointers to be derived from the same allocation is primarily
631
631
/// needed for `const`-compatibility: the distance between pointers into *different* allocated
632
632
/// objects is not known at compile-time. However, the requirement also exists at
633
633
/// runtime and may be exploited by optimizations. If you wish to compute the difference between
@@ -636,7 +636,7 @@ impl<T: ?Sized> *const T {
636
636
// FIXME: recommend `addr()` instead of `as usize` once that is stable.
637
637
///
638
638
/// [`add`]: #method.add
639
- /// [allocated object ]: crate::ptr#allocated-object
639
+ /// [allocation ]: crate::ptr#allocation
640
640
///
641
641
/// # Panics
642
642
///
@@ -969,12 +969,12 @@ impl<T: ?Sized> *const T {
969
969
/// "wrapping around"), must fit in an `isize`.
970
970
///
971
971
/// * If the computed offset is non-zero, then `self` must be [derived from][crate::ptr#provenance] a pointer to some
972
- /// [allocated object ], and the entire memory range between `self` and the result must be in
973
- /// bounds of that allocated object . In particular, this range must not "wrap around" the edge
972
+ /// [allocation ], and the entire memory range between `self` and the result must be in
973
+ /// bounds of that allocation . In particular, this range must not "wrap around" the edge
974
974
/// of the address space.
975
975
///
976
- /// Allocated objects can never be larger than `isize::MAX` bytes, so if the computed offset
977
- /// stays in bounds of the allocated object , it is guaranteed to satisfy the first requirement.
976
+ /// Allocations can never be larger than `isize::MAX` bytes, so if the computed offset
977
+ /// stays in bounds of the allocation , it is guaranteed to satisfy the first requirement.
978
978
/// This implies, for instance, that `vec.as_ptr().add(vec.len())` (for `vec: Vec<T>`) is always
979
979
/// safe.
980
980
///
@@ -983,7 +983,7 @@ impl<T: ?Sized> *const T {
983
983
/// enables more aggressive compiler optimizations.
984
984
///
985
985
/// [`wrapping_sub`]: #method.wrapping_sub
986
- /// [allocated object ]: crate::ptr#allocated-object
986
+ /// [allocation ]: crate::ptr#allocation
987
987
///
988
988
/// # Examples
989
989
///
@@ -1073,27 +1073,27 @@ impl<T: ?Sized> *const T {
1073
1073
///
1074
1074
/// This operation itself is always safe, but using the resulting pointer is not.
1075
1075
///
1076
- /// The resulting pointer "remembers" the [allocated object ] that `self` points to; it must not
1077
- /// be used to read or write other allocated objects .
1076
+ /// The resulting pointer "remembers" the [allocation ] that `self` points to; it must not
1077
+ /// be used to read or write other allocations .
1078
1078
///
1079
1079
/// In other words, `let z = x.wrapping_add((y as usize) - (x as usize))` does *not* make `z`
1080
1080
/// the same as `y` even if we assume `T` has size `1` and there is no overflow: `z` is still
1081
1081
/// attached to the object `x` is attached to, and dereferencing it is Undefined Behavior unless
1082
- /// `x` and `y` point into the same allocated object .
1082
+ /// `x` and `y` point into the same allocation .
1083
1083
///
1084
1084
/// Compared to [`add`], this method basically delays the requirement of staying within the
1085
- /// same allocated object : [`add`] is immediate Undefined Behavior when crossing object
1085
+ /// same allocation : [`add`] is immediate Undefined Behavior when crossing object
1086
1086
/// boundaries; `wrapping_add` produces a pointer but still leads to Undefined Behavior if a
1087
1087
/// pointer is dereferenced when it is out-of-bounds of the object it is attached to. [`add`]
1088
1088
/// can be optimized better and is thus preferable in performance-sensitive code.
1089
1089
///
1090
1090
/// The delayed check only considers the value of the pointer that was dereferenced, not the
1091
1091
/// intermediate values used during the computation of the final result. For example,
1092
1092
/// `x.wrapping_add(o).wrapping_sub(o)` is always the same as `x`. In other words, leaving the
1093
- /// allocated object and then re-entering it later is permitted.
1093
+ /// allocation and then re-entering it later is permitted.
1094
1094
///
1095
1095
/// [`add`]: #method.add
1096
- /// [allocated object ]: crate::ptr#allocated-object
1096
+ /// [allocation ]: crate::ptr#allocation
1097
1097
///
1098
1098
/// # Examples
1099
1099
///
@@ -1152,27 +1152,27 @@ impl<T: ?Sized> *const T {
1152
1152
///
1153
1153
/// This operation itself is always safe, but using the resulting pointer is not.
1154
1154
///
1155
- /// The resulting pointer "remembers" the [allocated object ] that `self` points to; it must not
1156
- /// be used to read or write other allocated objects .
1155
+ /// The resulting pointer "remembers" the [allocation ] that `self` points to; it must not
1156
+ /// be used to read or write other allocations .
1157
1157
///
1158
1158
/// In other words, `let z = x.wrapping_sub((x as usize) - (y as usize))` does *not* make `z`
1159
1159
/// the same as `y` even if we assume `T` has size `1` and there is no overflow: `z` is still
1160
1160
/// attached to the object `x` is attached to, and dereferencing it is Undefined Behavior unless
1161
- /// `x` and `y` point into the same allocated object .
1161
+ /// `x` and `y` point into the same allocation .
1162
1162
///
1163
1163
/// Compared to [`sub`], this method basically delays the requirement of staying within the
1164
- /// same allocated object : [`sub`] is immediate Undefined Behavior when crossing object
1164
+ /// same allocation : [`sub`] is immediate Undefined Behavior when crossing object
1165
1165
/// boundaries; `wrapping_sub` produces a pointer but still leads to Undefined Behavior if a
1166
1166
/// pointer is dereferenced when it is out-of-bounds of the object it is attached to. [`sub`]
1167
1167
/// can be optimized better and is thus preferable in performance-sensitive code.
1168
1168
///
1169
1169
/// The delayed check only considers the value of the pointer that was dereferenced, not the
1170
1170
/// intermediate values used during the computation of the final result. For example,
1171
1171
/// `x.wrapping_add(o).wrapping_sub(o)` is always the same as `x`. In other words, leaving the
1172
- /// allocated object and then re-entering it later is permitted.
1172
+ /// allocation and then re-entering it later is permitted.
1173
1173
///
1174
1174
/// [`sub`]: #method.sub
1175
- /// [allocated object ]: crate::ptr#allocated-object
1175
+ /// [allocation ]: crate::ptr#allocation
1176
1176
///
1177
1177
/// # Examples
1178
1178
///
@@ -1564,8 +1564,8 @@ impl<T> *const [T] {
1564
1564
/// * The pointer must be [valid] for reads for `ptr.len() * size_of::<T>()` many bytes,
1565
1565
/// and it must be properly aligned. This means in particular:
1566
1566
///
1567
- /// * The entire memory range of this slice must be contained within a single [allocated object ]!
1568
- /// Slices can never span across multiple allocated objects .
1567
+ /// * The entire memory range of this slice must be contained within a single [allocation ]!
1568
+ /// Slices can never span across multiple allocations .
1569
1569
///
1570
1570
/// * The pointer must be aligned even for zero-length slices. One
1571
1571
/// reason for this is that enum layout optimizations may rely on references
@@ -1586,7 +1586,7 @@ impl<T> *const [T] {
1586
1586
/// See also [`slice::from_raw_parts`][].
1587
1587
///
1588
1588
/// [valid]: crate::ptr#safety
1589
- /// [allocated object ]: crate::ptr#allocated-object
1589
+ /// [allocation ]: crate::ptr#allocation
1590
1590
///
1591
1591
/// # Panics during const evaluation
1592
1592
///
0 commit comments