File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,12 @@ use std::sync::atomic::{AtomicUsize, Ordering};
7
7
pub struct CollectConsumer < ' c , T : Send + ' c > {
8
8
/// Tracks how many items we successfully wrote. Used to guarantee
9
9
/// safety in the face of panics or buggy parallel iterators.
10
+ ///
11
+ /// In theory we could just produce this as a `CollectConsumer::Result`,
12
+ /// folding local counts and reducing by addition, but that requires a
13
+ /// certain amount of trust that the producer driving this will behave
14
+ /// itself. Since this count is important to the safety of marking the
15
+ /// memory initialized (`Vec::set_len`), we choose to keep it internal.
10
16
writes : & ' c AtomicUsize ,
11
17
12
18
/// A slice covering the target memory, not yet initialized!
You can’t perform that action at this time.
0 commit comments