@@ -10,24 +10,24 @@ When calling this method, you have to ensure that *either* the pointer is null *
1010all of the following is true:
1111
1212* The pointer must be [ valid] for reads for ` ptr.len() * size_of::<T>() ` many bytes,
13- and it must be properly aligned. This means in particular:
13+ and it must be properly aligned. This means in particular:
1414
1515* The entire memory range of this slice must be contained within a single [ allocation] !
16- Slices can never span across multiple allocations.
16+ Slices can never span across multiple allocations.
1717
1818* The pointer must be aligned even for zero-length slices. One
19- reason for this is that enum layout optimizations may rely on references
20- (including slices of any length) being aligned and non-null to distinguish
21- them from other data. You can obtain a pointer that is usable as ` data `
22- for zero-length slices using [ ` NonNull::dangling() ` ] .
19+ reason for this is that enum layout optimizations may rely on references
20+ (including slices of any length) being aligned and non-null to distinguish
21+ them from other data. You can obtain a pointer that is usable as ` data `
22+ for zero-length slices using [ ` NonNull::dangling() ` ] .
2323
2424* The total size ` ptr.len() * size_of::<T>() ` of the slice must be no larger than ` isize::MAX ` .
25- See the safety documentation of [ ` pointer::offset ` ] .
25+ See the safety documentation of [ ` pointer::offset ` ] .
2626
2727* You must enforce Rust's aliasing rules, since the returned lifetime ` 'a ` is
28- arbitrarily chosen and does not necessarily reflect the actual lifetime of the data.
29- In particular, while this reference exists, the memory the pointer points to must
30- not get mutated (except inside ` UnsafeCell ` ).
28+ arbitrarily chosen and does not necessarily reflect the actual lifetime of the data.
29+ In particular, while this reference exists, the memory the pointer points to must
30+ not get mutated (except inside ` UnsafeCell ` ).
3131
3232This applies even if the result of this method is unused!
3333
0 commit comments