From df65b33f8a9dbd06b95b0a6af7521f0d47233545 Mon Sep 17 00:00:00 2001 From: Tad Hardesty Date: Mon, 16 Dec 2019 21:56:44 -0800 Subject: [PATCH] Fix mem::uninitialized UB warning --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 34a86e6..5abdea2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1135,7 +1135,7 @@ impl IntoIterator for LinkedHashMap { } 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 {