about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2015-03-21 10:34:15 +0100
committerMs2ger <ms2ger@gmail.com>2015-03-22 20:27:00 +0100
commit29aca83eb46cdc39dc695852ab30bb0ad06bea8f (patch)
treeca10a416ff8f9db6575c89b099d3c0f0120be5d2 /src/libstd
parentecf8c64e1b1b60f228f0c472c0b0dab4a5b5aa61 (diff)
downloadrust-29aca83eb46cdc39dc695852ab30bb0ad06bea8f.tar.gz
rust-29aca83eb46cdc39dc695852ab30bb0ad06bea8f.zip
Remove an unsafe function definition in __thread_local_inner.
This fixes a build error when using thread_local!() in a deny(unsafe_code)
scope in Servo for Android.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/thread_local/mod.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/libstd/thread_local/mod.rs b/src/libstd/thread_local/mod.rs
index 08780292c88..380ac0c838e 100644
--- a/src/libstd/thread_local/mod.rs
+++ b/src/libstd/thread_local/mod.rs
@@ -205,15 +205,13 @@ macro_rules! __thread_local_inner {
 
         #[cfg(any(not(any(target_os = "macos", target_os = "linux")), target_arch = "aarch64"))]
         const _INIT: ::std::thread_local::__impl::KeyInner<$t> = {
-            unsafe extern fn __destroy(ptr: *mut u8) {
-                ::std::thread_local::__impl::destroy_value::<$t>(ptr);
-            }
-
             ::std::thread_local::__impl::KeyInner {
                 inner: ::std::cell::UnsafeCell { value: $init },
                 os: ::std::thread_local::__impl::OsStaticKey {
                     inner: ::std::thread_local::__impl::OS_INIT_INNER,
-                    dtor: ::std::option::Option::Some(__destroy as unsafe extern fn(*mut u8)),
+                    dtor: ::std::option::Option::Some(
+                        ::std::thread_local::__impl::destroy_value::<$t>
+                    ),
                 },
             }
         };