@@ -384,13 +384,13 @@ impl<T: ?Sized> *const T {
384
384
/// "wrapping around"), must fit in an `isize`.
385
385
///
386
386
/// * If the computed offset is non-zero, then `self` must be [derived from][crate::ptr#provenance] a pointer to some
387
- /// [allocated object ], and the entire memory range between `self` and the result must be in
388
- /// bounds of that allocated object . In particular, this range must not "wrap around" the edge
387
+ /// [allocation ], and the entire memory range between `self` and the result must be in
388
+ /// bounds of that allocation . In particular, this range must not "wrap around" the edge
389
389
/// of the address space. Note that "range" here refers to a half-open range as usual in Rust,
390
390
/// i.e., `self..result` for non-negative offsets and `result..self` for negative offsets.
391
391
///
392
- /// Allocated objects can never be larger than `isize::MAX` bytes, so if the computed offset
393
- /// stays in bounds of the allocated object , it is guaranteed to satisfy the first requirement.
392
+ /// Allocations can never be larger than `isize::MAX` bytes, so if the computed offset
393
+ /// stays in bounds of the allocation , it is guaranteed to satisfy the first requirement.
394
394
/// This implies, for instance, that `vec.as_ptr().add(vec.len())` (for `vec: Vec<T>`) is always
395
395
/// safe.
396
396
///
@@ -399,7 +399,7 @@ impl<T: ?Sized> *const T {
399
399
/// enables more aggressive compiler optimizations.
400
400
///
401
401
/// [`wrapping_offset`]: #method.wrapping_offset
402
- /// [allocated object ]: crate::ptr#allocated-object
402
+ /// [allocation ]: crate::ptr#allocation
403
403
///
404
404
/// # Examples
405
405
///
@@ -484,28 +484,28 @@ impl<T: ?Sized> *const T {
484
484
///
485
485
/// This operation itself is always safe, but using the resulting pointer is not.
486
486
///
487
- /// The resulting pointer "remembers" the [allocated object ] that `self` points to
487
+ /// The resulting pointer "remembers" the [allocation ] that `self` points to
488
488
/// (this is called "[Provenance](ptr/index.html#provenance)").
489
- /// The pointer must not be used to read or write other allocated objects .
489
+ /// The pointer must not be used to read or write other allocations .
490
490
///
491
491
/// In other words, `let z = x.wrapping_offset((y as isize) - (x as isize))` does *not* make `z`
492
492
/// the same as `y` even if we assume `T` has size `1` and there is no overflow: `z` is still
493
493
/// attached to the object `x` is attached to, and dereferencing it is Undefined Behavior unless
494
- /// `x` and `y` point into the same allocated object .
494
+ /// `x` and `y` point into the same allocation .
495
495
///
496
496
/// Compared to [`offset`], this method basically delays the requirement of staying within the
497
- /// same allocated object : [`offset`] is immediate Undefined Behavior when crossing object
497
+ /// same allocation : [`offset`] is immediate Undefined Behavior when crossing object
498
498
/// boundaries; `wrapping_offset` produces a pointer but still leads to Undefined Behavior if a
499
499
/// pointer is dereferenced when it is out-of-bounds of the object it is attached to. [`offset`]
500
500
/// can be optimized better and is thus preferable in performance-sensitive code.
501
501
///
502
502
/// The delayed check only considers the value of the pointer that was dereferenced, not the
503
503
/// intermediate values used during the computation of the final result. For example,
504
504
/// `x.wrapping_offset(o).wrapping_offset(o.wrapping_neg())` is always the same as `x`. In other
505
- /// words, leaving the allocated object and then re-entering it later is permitted.
505
+ /// words, leaving the allocation and then re-entering it later is permitted.
506
506
///
507
507
/// [`offset`]: #method.offset
508
- /// [allocated object ]: crate::ptr#allocated-object
508
+ /// [allocation ]: crate::ptr#allocation
509
509
///
510
510
/// # Examples
511
511
///
@@ -618,18 +618,18 @@ impl<T: ?Sized> *const T {
618
618
/// * `self` and `origin` must either
619
619
///
620
620
/// * point to the same address, or
621
- /// * both be [derived from][crate::ptr#provenance] a pointer to the same [allocated object ], and the memory range between
621
+ /// * both be [derived from][crate::ptr#provenance] a pointer to the same [allocation ], and the memory range between
622
622
/// the two pointers must be in bounds of that object. (See below for an example.)
623
623
///
624
624
/// * The distance between the pointers, in bytes, must be an exact multiple
625
625
/// of the size of `T`.
626
626
///
627
627
/// As a consequence, the absolute distance between the pointers, in bytes, computed on
628
628
/// mathematical integers (without "wrapping around"), cannot overflow an `isize`. This is
629
- /// implied by the in-bounds requirement, and the fact that no allocated object can be larger
629
+ /// implied by the in-bounds requirement, and the fact that no allocation can be larger
630
630
/// than `isize::MAX` bytes.
631
631
///
632
- /// The requirement for pointers to be derived from the same allocated object is primarily
632
+ /// The requirement for pointers to be derived from the same allocation is primarily
633
633
/// needed for `const`-compatibility: the distance between pointers into *different* allocated
634
634
/// objects is not known at compile-time. However, the requirement also exists at
635
635
/// runtime and may be exploited by optimizations. If you wish to compute the difference between
@@ -638,7 +638,7 @@ impl<T: ?Sized> *const T {
638
638
// FIXME: recommend `addr()` instead of `as usize` once that is stable.
639
639
///
640
640
/// [`add`]: #method.add
641
- /// [allocated object ]: crate::ptr#allocated-object
641
+ /// [allocation ]: crate::ptr#allocation
642
642
///
643
643
/// # Panics
644
644
///
@@ -896,12 +896,12 @@ impl<T: ?Sized> *const T {
896
896
/// "wrapping around"), must fit in an `isize`.
897
897
///
898
898
/// * If the computed offset is non-zero, then `self` must be [derived from][crate::ptr#provenance] a pointer to some
899
- /// [allocated object ], and the entire memory range between `self` and the result must be in
900
- /// bounds of that allocated object . In particular, this range must not "wrap around" the edge
899
+ /// [allocation ], and the entire memory range between `self` and the result must be in
900
+ /// bounds of that allocation . In particular, this range must not "wrap around" the edge
901
901
/// of the address space.
902
902
///
903
- /// Allocated objects can never be larger than `isize::MAX` bytes, so if the computed offset
904
- /// stays in bounds of the allocated object , it is guaranteed to satisfy the first requirement.
903
+ /// Allocations can never be larger than `isize::MAX` bytes, so if the computed offset
904
+ /// stays in bounds of the allocation , it is guaranteed to satisfy the first requirement.
905
905
/// This implies, for instance, that `vec.as_ptr().add(vec.len())` (for `vec: Vec<T>`) is always
906
906
/// safe.
907
907
///
@@ -910,7 +910,7 @@ impl<T: ?Sized> *const T {
910
910
/// enables more aggressive compiler optimizations.
911
911
///
912
912
/// [`wrapping_add`]: #method.wrapping_add
913
- /// [allocated object ]: crate::ptr#allocated-object
913
+ /// [allocation ]: crate::ptr#allocation
914
914
///
915
915
/// # Examples
916
916
///
@@ -1002,12 +1002,12 @@ impl<T: ?Sized> *const T {
1002
1002
/// "wrapping around"), must fit in an `isize`.
1003
1003
///
1004
1004
/// * If the computed offset is non-zero, then `self` must be [derived from][crate::ptr#provenance] a pointer to some
1005
- /// [allocated object ], and the entire memory range between `self` and the result must be in
1006
- /// bounds of that allocated object . In particular, this range must not "wrap around" the edge
1005
+ /// [allocation ], and the entire memory range between `self` and the result must be in
1006
+ /// bounds of that allocation . In particular, this range must not "wrap around" the edge
1007
1007
/// of the address space.
1008
1008
///
1009
- /// Allocated objects can never be larger than `isize::MAX` bytes, so if the computed offset
1010
- /// stays in bounds of the allocated object , it is guaranteed to satisfy the first requirement.
1009
+ /// Allocations can never be larger than `isize::MAX` bytes, so if the computed offset
1010
+ /// stays in bounds of the allocation , it is guaranteed to satisfy the first requirement.
1011
1011
/// This implies, for instance, that `vec.as_ptr().add(vec.len())` (for `vec: Vec<T>`) is always
1012
1012
/// safe.
1013
1013
///
@@ -1016,7 +1016,7 @@ impl<T: ?Sized> *const T {
1016
1016
/// enables more aggressive compiler optimizations.
1017
1017
///
1018
1018
/// [`wrapping_sub`]: #method.wrapping_sub
1019
- /// [allocated object ]: crate::ptr#allocated-object
1019
+ /// [allocation ]: crate::ptr#allocation
1020
1020
///
1021
1021
/// # Examples
1022
1022
///
@@ -1106,27 +1106,27 @@ impl<T: ?Sized> *const T {
1106
1106
///
1107
1107
/// This operation itself is always safe, but using the resulting pointer is not.
1108
1108
///
1109
- /// The resulting pointer "remembers" the [allocated object ] that `self` points to; it must not
1110
- /// be used to read or write other allocated objects .
1109
+ /// The resulting pointer "remembers" the [allocation ] that `self` points to; it must not
1110
+ /// be used to read or write other allocations .
1111
1111
///
1112
1112
/// In other words, `let z = x.wrapping_add((y as usize) - (x as usize))` does *not* make `z`
1113
1113
/// the same as `y` even if we assume `T` has size `1` and there is no overflow: `z` is still
1114
1114
/// attached to the object `x` is attached to, and dereferencing it is Undefined Behavior unless
1115
- /// `x` and `y` point into the same allocated object .
1115
+ /// `x` and `y` point into the same allocation .
1116
1116
///
1117
1117
/// Compared to [`add`], this method basically delays the requirement of staying within the
1118
- /// same allocated object : [`add`] is immediate Undefined Behavior when crossing object
1118
+ /// same allocation : [`add`] is immediate Undefined Behavior when crossing object
1119
1119
/// boundaries; `wrapping_add` produces a pointer but still leads to Undefined Behavior if a
1120
1120
/// pointer is dereferenced when it is out-of-bounds of the object it is attached to. [`add`]
1121
1121
/// can be optimized better and is thus preferable in performance-sensitive code.
1122
1122
///
1123
1123
/// The delayed check only considers the value of the pointer that was dereferenced, not the
1124
1124
/// intermediate values used during the computation of the final result. For example,
1125
1125
/// `x.wrapping_add(o).wrapping_sub(o)` is always the same as `x`. In other words, leaving the
1126
- /// allocated object and then re-entering it later is permitted.
1126
+ /// allocation and then re-entering it later is permitted.
1127
1127
///
1128
1128
/// [`add`]: #method.add
1129
- /// [allocated object ]: crate::ptr#allocated-object
1129
+ /// [allocation ]: crate::ptr#allocation
1130
1130
///
1131
1131
/// # Examples
1132
1132
///
@@ -1185,27 +1185,27 @@ impl<T: ?Sized> *const T {
1185
1185
///
1186
1186
/// This operation itself is always safe, but using the resulting pointer is not.
1187
1187
///
1188
- /// The resulting pointer "remembers" the [allocated object ] that `self` points to; it must not
1189
- /// be used to read or write other allocated objects .
1188
+ /// The resulting pointer "remembers" the [allocation ] that `self` points to; it must not
1189
+ /// be used to read or write other allocations .
1190
1190
///
1191
1191
/// In other words, `let z = x.wrapping_sub((x as usize) - (y as usize))` does *not* make `z`
1192
1192
/// the same as `y` even if we assume `T` has size `1` and there is no overflow: `z` is still
1193
1193
/// attached to the object `x` is attached to, and dereferencing it is Undefined Behavior unless
1194
- /// `x` and `y` point into the same allocated object .
1194
+ /// `x` and `y` point into the same allocation .
1195
1195
///
1196
1196
/// Compared to [`sub`], this method basically delays the requirement of staying within the
1197
- /// same allocated object : [`sub`] is immediate Undefined Behavior when crossing object
1197
+ /// same allocation : [`sub`] is immediate Undefined Behavior when crossing object
1198
1198
/// boundaries; `wrapping_sub` produces a pointer but still leads to Undefined Behavior if a
1199
1199
/// pointer is dereferenced when it is out-of-bounds of the object it is attached to. [`sub`]
1200
1200
/// can be optimized better and is thus preferable in performance-sensitive code.
1201
1201
///
1202
1202
/// The delayed check only considers the value of the pointer that was dereferenced, not the
1203
1203
/// intermediate values used during the computation of the final result. For example,
1204
1204
/// `x.wrapping_add(o).wrapping_sub(o)` is always the same as `x`. In other words, leaving the
1205
- /// allocated object and then re-entering it later is permitted.
1205
+ /// allocation and then re-entering it later is permitted.
1206
1206
///
1207
1207
/// [`sub`]: #method.sub
1208
- /// [allocated object ]: crate::ptr#allocated-object
1208
+ /// [allocation ]: crate::ptr#allocation
1209
1209
///
1210
1210
/// # Examples
1211
1211
///
@@ -1597,8 +1597,8 @@ impl<T> *const [T] {
1597
1597
/// * The pointer must be [valid] for reads for `ptr.len() * size_of::<T>()` many bytes,
1598
1598
/// and it must be properly aligned. This means in particular:
1599
1599
///
1600
- /// * The entire memory range of this slice must be contained within a single [allocated object ]!
1601
- /// Slices can never span across multiple allocated objects .
1600
+ /// * The entire memory range of this slice must be contained within a single [allocation ]!
1601
+ /// Slices can never span across multiple allocations .
1602
1602
///
1603
1603
/// * The pointer must be aligned even for zero-length slices. One
1604
1604
/// reason for this is that enum layout optimizations may rely on references
@@ -1619,7 +1619,7 @@ impl<T> *const [T] {
1619
1619
/// See also [`slice::from_raw_parts`][].
1620
1620
///
1621
1621
/// [valid]: crate::ptr#safety
1622
- /// [allocated object ]: crate::ptr#allocated-object
1622
+ /// [allocation ]: crate::ptr#allocation
1623
1623
///
1624
1624
/// # Panics during const evaluation
1625
1625
///
0 commit comments