Skip to content

Commit

Permalink
Fix mem::uninitialized UB warning
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceManiac committed Dec 17, 2019
1 parent 4485163 commit df65b33
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 df65b33

Please sign in to comment.