]> git.lizzy.rs Git - rust.git/commitdiff
no TLS dtor and no leak checks on macOS
authorRalf Jung <post@ralfj.de>
Thu, 30 Aug 2018 07:41:57 +0000 (09:41 +0200)
committerRalf Jung <post@ralfj.de>
Thu, 30 Aug 2018 07:41:57 +0000 (09:41 +0200)
src/fn_call.rs
src/lib.rs
tests/compile-fail/memleak.rs
tests/compile-fail/memleak_rc.rs

index fb77f01876d907dd332e24072681028eda8d80dd..a9791e2b7ca7fd7ede758c8085ffda1a71e6d94d 100644 (file)
@@ -539,7 +539,7 @@ fn emulate_foreign_item(
             }
 
             "_tlv_atexit" => {
-                return err!(Unimplemented("Thread-local store is not fully supported on macOS".to_owned()));
+                // FIXME: Register the dtor
             },
 
             // Determining stack base address
index 8fff4635fa0ef8e24be18aafd9926ace43a755c6..42dac6a28d855a061e2287d8e63d1d477bfeb967 100644 (file)
@@ -161,8 +161,9 @@ pub fn eval_main<'a, 'tcx: 'a>(
             let leaks = ecx.memory().leak_report();
             // Disable the leak test on some platforms where we likely do not
             // correctly implement TLS destructors.
-            let target_os = &ecx.tcx.tcx.sess.target.target.target_os;
-            if target_os.to_lowercase() != "windows" && leaks != 0 {
+            let target_os = ecx.tcx.tcx.sess.target.target.target_os.to_lowercase();
+            let ignore_leaks = target_os == "windows" || target_os == "macos";
+            if !ignore_leaks && leaks != 0 {
                 tcx.sess.err("the evaluated program leaked memory");
             }
         }
index 7f155edc35a51bd56f1151afe90022c0e7db293d..06e01d7aea3a52458ec55e6e521c2e0d165c9edb 100644 (file)
@@ -1,4 +1,5 @@
-// ignore-windows
+// ignore-windows: We do not check leaks on Windows
+// ignore-macos: We do not check leaks on macOS
 
 //error-pattern: the evaluated program leaked memory
 
index 24e8363049c8c4047c0af1759111d4d8d0e2cd13..14a85ecd8947cd2c051013fe7678547f4c5dc448 100644 (file)
@@ -1,4 +1,5 @@
-// ignore-windows
+// ignore-windows: We do not check leaks on Windows
+// ignore-macos: We do not check leaks on macOS
 
 //error-pattern: the evaluated program leaked memory