Skip to content

Commit 4f681be

Browse files
authored
Merge pull request #100 from SpaceManiac/fix-ub-warnings
Fix mem::uninitialized UB warning
2 parents 4485163 + df65b33 commit 4f681be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,7 @@ impl<K: Hash + Eq, V, S: BuildHasher> IntoIterator for LinkedHashMap<K, V, S> {
11351135
}
11361136
self.clear_free_list();
11371137
// drop the HashMap but not the LinkedHashMap
1138-
self.map = unsafe { mem::uninitialized() };
1138+
unsafe { ptr::drop_in_place(&mut self.map); }
11391139
mem::forget(self);
11401140

11411141
IntoIter {

0 commit comments

Comments
 (0)