File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -136,6 +136,7 @@ pub mod tests {
136
136
137
137
#[ test]
138
138
pub fn test_incref_decref_drop ( ) {
139
+ use std:: mem:: ManuallyDrop ;
139
140
let mut obj = TestObject :: from_id ( h5call ! ( H5Pcreate ( * H5P_FILE_ACCESS ) ) . unwrap ( ) ) . unwrap ( ) ;
140
141
let obj_id = obj. id ( ) ;
141
142
obj = TestObject :: from_id ( h5call ! ( H5Pcreate ( * H5P_FILE_ACCESS ) ) . unwrap ( ) ) . unwrap ( ) ;
@@ -157,12 +158,12 @@ pub mod tests {
157
158
158
159
// obj is already owned, we must ensure we do not call drop on this without
159
160
// an incref
160
- let mut obj2 = std :: mem :: ManuallyDrop :: new ( TestObject :: from_id ( obj. id ( ) ) . unwrap ( ) ) ;
161
+ let mut obj2 = ManuallyDrop :: new ( TestObject :: from_id ( obj. id ( ) ) . unwrap ( ) ) ;
161
162
assert_eq ! ( obj. refcount( ) , 1 ) ;
162
163
163
164
obj2. incref ( ) ;
164
165
// We can now take, as we have exactly two handles
165
- let obj2 = unsafe { std :: mem :: ManuallyDrop :: take ( & mut obj2) } ;
166
+ let obj2 = unsafe { ManuallyDrop :: take ( & mut obj2) } ;
166
167
167
168
h5lock ! ( {
168
169
// We must hold a lock here to prevent another thread creating an object
You can’t perform that action at this time.
0 commit comments