File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ use core::{
1111 mem:: ManuallyDrop ,
1212 ops:: { Deref , DerefMut } ,
1313 pin:: Pin ,
14- ptr:: drop_in_place,
1514} ;
1615
1716/// The state within a `RevocableMutex` that is protected by a mutex.
@@ -138,10 +137,11 @@ impl<T: ?Sized> RevocableMutex<T> {
138137 return ;
139138 }
140139
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 ) } ;
144140 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 ) } ;
145145 }
146146}
147147
You can’t perform that action at this time.
0 commit comments