File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ use core::{
11
11
mem:: ManuallyDrop ,
12
12
ops:: { Deref , DerefMut } ,
13
13
pin:: Pin ,
14
- ptr:: drop_in_place,
15
14
} ;
16
15
17
16
/// The state within a `RevocableMutex` that is protected by a mutex.
@@ -138,10 +137,11 @@ impl<T: ?Sized> RevocableMutex<T> {
138
137
return ;
139
138
}
140
139
141
- // SAFETY: We know `inner.data` is valid because `is_available` is set to true. We'll drop
142
- // it here and set it to false so it isn't dropped again.
143
- unsafe { drop_in_place ( & mut inner. data ) } ;
144
140
inner. is_available = false ;
141
+
142
+ // SAFETY: We know `inner.data` is valid because `is_available` was true. We'll drop it
143
+ // here, and given that we set `is_available` to false above, it won't be dropped again.
144
+ unsafe { ManuallyDrop :: drop ( & mut inner. data ) } ;
145
145
}
146
146
}
147
147
You can’t perform that action at this time.
0 commit comments