1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/// Copy each value from `src` through the corresponding pointer in `dst`.
///
/// # Safety
///
/// * `dst` and `src` must have equal length (enforced by debug assert).
/// * Every pointer in `dst` must be valid for writes of `T` and properly
/// aligned. Aliased pointers within `dst` produce undefined behaviour.
/// * No concurrent reader may access the locations written through `dst`.
pub unsafe
/// Pairwise-swap the values pointed to by `lhs` and `rhs`.
///
/// # Safety
///
/// * `lhs` and `rhs` must have equal length (enforced by debug assert).
/// * Each `(lhs[i], rhs[i])` pair must point to valid, properly-aligned
/// `T` locations and must not alias another live reference.
/// * `lhs` and `rhs` themselves must point to disjoint memory.
pub unsafe
/// Dereference every pointer in `pv` and collect the values into a `Vec`.
///
/// # Safety
///
/// Every pointer in `pv` must be valid for reads of `T`, properly
/// aligned, and must outlive the call. The pointed-to data must not be
/// mutated through another reference during the call.
pub unsafe