File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,10 @@ pub struct Ref<'a, T: ?Sized + 'a> {
4747 value : NonNull < T > ,
4848}
4949
50+ // SAFETY: `Ref<'_, T> acts as a reference.
51+ unsafe impl < ' a , T : ?Sized + ' a > Sync for Ref < ' a , T > where for < ' b > & ' b T : Sync { }
52+ unsafe impl < ' a , T : ?Sized + ' a > Send for Ref < ' a , T > where for < ' b > & ' b T : Send { }
53+
5054impl < ' a , T : ?Sized > Ref < ' a , T > {
5155 /// Makes a new `Ref` for a component of the borrowed data which preserves
5256 /// the existing borrow.
@@ -143,6 +147,10 @@ pub struct RefMut<'a, T: ?Sized + 'a> {
143147 marker : PhantomData < & ' a mut T > ,
144148}
145149
150+ // SAFETY: `RefMut<'_, T> acts as a mutable reference.
151+ unsafe impl < ' a , T : ?Sized + ' a > Sync for RefMut < ' a , T > where for < ' b > & ' b mut T : Sync { }
152+ unsafe impl < ' a , T : ?Sized + ' a > Send for RefMut < ' a , T > where for < ' b > & ' b mut T : Send { }
153+
146154impl < ' a , T : ?Sized > RefMut < ' a , T > {
147155 /// Makes a new `RefMut` for a component of the borrowed data which
148156 /// preserves the existing borrow.
You can’t perform that action at this time.
0 commit comments