From 654ca47351a43d054720a3549c5fab67c36a42f0 Mon Sep 17 00:00:00 2001
From: Jeremy Soller <jackpot51@gmail.com>
Date: Sun, 4 Mar 2018 08:15:26 -0700
Subject: [PATCH] Fix atexit_funcs call in exit

---
 src/stdlib/src/lib.rs | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/stdlib/src/lib.rs b/src/stdlib/src/lib.rs
index 91ddb072..5beef27e 100644
--- a/src/stdlib/src/lib.rs
+++ b/src/stdlib/src/lib.rs
@@ -116,8 +116,7 @@ pub unsafe extern "C" fn exit(status: c_int) {
     use core::mem;
 
     for i in (0..ATEXIT_FUNCS.len()).rev() {
-        if ATEXIT_FUNCS[i] != None {
-            let func = mem::transmute::<usize, extern "C" fn()>(ATEXIT_FUNCS[i].unwrap());
+        if let Some(func) = ATEXIT_FUNCS[i] {
             (func)();
         }
     }
-- 
GitLab