about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-07-24 02:40:42 +0000
committerbors <bors@rust-lang.org>2015-07-24 02:40:42 +0000
commit68e0d13bfdcb83bfd4232ad33a1a7e271bff8994 (patch)
treee9f178bd17443ca3edd27bd6c96ef8b20eb7a025 /src/libstd
parent69ca0125641db798f072f9a0f5d838686255eb37 (diff)
parent6fa17b43d351ed4f9093cf80f4044d1208044241 (diff)
downloadrust-68e0d13bfdcb83bfd4232ad33a1a7e271bff8994.tar.gz
rust-68e0d13bfdcb83bfd4232ad33a1a7e271bff8994.zip
Auto merge of #26583 - eefriedman:lint-ffi, r=nrc
Makes the lint a bit more accurate, and improves the quality of the diagnostic
messages by explicitly returning an error message.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/rt/unwind/gcc.rs11
-rw-r--r--src/libstd/sys/windows/stack_overflow.rs2
-rw-r--r--src/libstd/thread/local.rs4
3 files changed, 9 insertions, 8 deletions
diff --git a/src/libstd/rt/unwind/gcc.rs b/src/libstd/rt/unwind/gcc.rs
index 87941e79b2f..59fc8df6107 100644
--- a/src/libstd/rt/unwind/gcc.rs
+++ b/src/libstd/rt/unwind/gcc.rs
@@ -251,12 +251,11 @@ pub mod eabi {
     use rt::libunwind as uw;
     use libc::{c_void, c_int};
 
-    #[repr(C)]
-    pub struct EXCEPTION_RECORD;
-    #[repr(C)]
-    pub struct CONTEXT;
-    #[repr(C)]
-    pub struct DISPATCHER_CONTEXT;
+    // Fake definitions; these are actually complicated structs,
+    // but we don't use the contents here.
+    pub type EXCEPTION_RECORD = c_void;
+    pub type CONTEXT = c_void;
+    pub type DISPATCHER_CONTEXT = c_void;
 
     #[repr(C)]
     #[derive(Copy, Clone)]
diff --git a/src/libstd/sys/windows/stack_overflow.rs b/src/libstd/sys/windows/stack_overflow.rs
index cf827848db5..491b53c4ed9 100644
--- a/src/libstd/sys/windows/stack_overflow.rs
+++ b/src/libstd/sys/windows/stack_overflow.rs
@@ -82,6 +82,7 @@ pub unsafe fn make_handler() -> Handler {
     Handler { _data: 0 as *mut libc::c_void }
 }
 
+#[repr(C)]
 pub struct EXCEPTION_RECORD {
     pub ExceptionCode: DWORD,
     pub ExceptionFlags: DWORD,
@@ -91,6 +92,7 @@ pub struct EXCEPTION_RECORD {
     pub ExceptionInformation: [LPVOID; EXCEPTION_MAXIMUM_PARAMETERS]
 }
 
+#[repr(C)]
 pub struct EXCEPTION_POINTERS {
     pub ExceptionRecord: *mut EXCEPTION_RECORD,
     pub ContextRecord: LPVOID
diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs
index e2873601a7b..11b375dcce2 100644
--- a/src/libstd/thread/local.rs
+++ b/src/libstd/thread/local.rs
@@ -335,13 +335,13 @@ mod imp {
             #[linkage = "extern_weak"]
             static __dso_handle: *mut u8;
             #[linkage = "extern_weak"]
-            static __cxa_thread_atexit_impl: *const ();
+            static __cxa_thread_atexit_impl: *const libc::c_void;
         }
         if !__cxa_thread_atexit_impl.is_null() {
             type F = unsafe extern fn(dtor: unsafe extern fn(*mut u8),
                                       arg: *mut u8,
                                       dso_handle: *mut u8) -> libc::c_int;
-            mem::transmute::<*const (), F>(__cxa_thread_atexit_impl)
+            mem::transmute::<*const libc::c_void, F>(__cxa_thread_atexit_impl)
             (dtor, t, &__dso_handle as *const _ as *mut _);
             return
         }