File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -142,11 +142,9 @@ impl<T: Copy + fmt::Debug> fmt::Debug for VarLenArray<T> {
142142 }
143143}
144144
145- // Safety: `VarLenArray` allocates and frees memory for its data, which is copied
146- // from its original location; it never holds a reference to the data used to create it.
147- // Therefore if `T` is Send, so is `VarLenArray<T>`
145+ // Safety: Memory backed by `VarLenArray` can be accessed and freed from any thread
148146unsafe impl < T : Copy + Send > Send for VarLenArray < T > { }
149- // Safety: No interior mutability or potential for data races if `T` is `Sync`.
147+ // Safety: `VarLenArray` has no interior mutability
150148unsafe impl < T : Copy + Sync > Sync for VarLenArray < T > { }
151149
152150#[ cfg( test) ]
Original file line number Diff line number Diff line change @@ -282,10 +282,9 @@ impl AsAsciiStr for VarLenAscii {
282282 }
283283}
284284
285- // Safety: `VarLenAscii` allocates and frees memory for its data, which is copied
286- // from its original location; it never holds a reference to the data used to create it.
285+ // Safety: Memory backed by `VarLenAscii` can be accessed and freed from any thread
287286unsafe impl Send for VarLenAscii { }
288- // Safety: No interior mutability or potential for data races.
287+ // Safety: `VarLenAscii` has no interior mutability
289288unsafe impl Sync for VarLenAscii { }
290289
291290// ================================================================================
@@ -377,10 +376,9 @@ impl FromStr for VarLenUnicode {
377376 }
378377}
379378
380- // Safety: `VarLenUnicode` allocates and frees memory for its data, which is copied
381- // from its original location; it never holds a reference to the data used to create it.
379+ // Safety: Memory backed by `VarLenUnicode` can be accessed and freed from any thread
382380unsafe impl Send for VarLenUnicode { }
383- // Safety: No interior mutability or potential for data races.
381+ // Safety: `VarLenUnicode` has no interior mutability
384382unsafe impl Sync for VarLenUnicode { }
385383
386384// ================================================================================
You can’t perform that action at this time.
0 commit comments