Skip to content

Commit

Permalink
Remove an unsafe function definition in __thread_local_inner.
Browse files Browse the repository at this point in the history
This fixes a build error when using thread_local!() in a deny(unsafe_code)
scope in Servo for Android.
  • Loading branch information
Ms2ger committed Mar 22, 2015
1 parent ecf8c64 commit 29aca83
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/libstd/thread_local/mod.rs
Expand Up @@ -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>
),
},
}
};
Expand Down

0 comments on commit 29aca83

Please sign in to comment.