Skip to content

Commit

Permalink
Merge pull request #100 from SpaceManiac/fix-ub-warnings
Browse files Browse the repository at this point in the history
Fix mem::uninitialized UB warning
  • Loading branch information
Gankra authored Dec 17, 2019
2 parents 4485163 + df65b33 commit 4f681be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,7 @@ impl<K: Hash + Eq, V, S: BuildHasher> IntoIterator for LinkedHashMap<K, V, S> {
}
self.clear_free_list();
// drop the HashMap but not the LinkedHashMap
self.map = unsafe { mem::uninitialized() };
unsafe { ptr::drop_in_place(&mut self.map); }
mem::forget(self);

IntoIter {
Expand Down

0 comments on commit 4f681be

Please sign in to comment.