File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -142,6 +142,11 @@ impl<T: Copy + fmt::Debug> fmt::Debug for VarLenArray<T> {
142
142
}
143
143
}
144
144
145
+ // Safety: Memory backed by `VarLenArray` can be accessed and freed from any thread
146
+ unsafe impl < T : Copy + Send > Send for VarLenArray < T > { }
147
+ // Safety: `VarLenArray` has no interior mutability
148
+ unsafe impl < T : Copy + Sync > Sync for VarLenArray < T > { }
149
+
145
150
#[ cfg( test) ]
146
151
pub mod tests {
147
152
use super :: VarLenArray ;
Original file line number Diff line number Diff line change @@ -282,6 +282,11 @@ impl AsAsciiStr for VarLenAscii {
282
282
}
283
283
}
284
284
285
+ // Safety: Memory backed by `VarLenAscii` can be accessed and freed from any thread
286
+ unsafe impl Send for VarLenAscii { }
287
+ // Safety: `VarLenAscii` has no interior mutability
288
+ unsafe impl Sync for VarLenAscii { }
289
+
285
290
// ================================================================================
286
291
287
292
#[ repr( C ) ]
@@ -371,6 +376,11 @@ impl FromStr for VarLenUnicode {
371
376
}
372
377
}
373
378
379
+ // Safety: Memory backed by `VarLenUnicode` can be accessed and freed from any thread
380
+ unsafe impl Send for VarLenUnicode { }
381
+ // Safety: `VarLenUnicode` has no interior mutability
382
+ unsafe impl Sync for VarLenUnicode { }
383
+
374
384
// ================================================================================
375
385
376
386
#[ repr( C ) ]
You can’t perform that action at this time.
0 commit comments