about summary refs log tree commit diff
path: root/src/libnative
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-06-10 09:49:29 -0700
committerbors <bors@rust-lang.org>2014-06-10 09:49:29 -0700
commit9bb8f88d3a79d3f8f10dca8cedf00cf57f6a94f6 (patch)
tree6b900931014b0ea0ed76e2b6ee5ab2f78583b165 /src/libnative
parent0ee6a8e8a564ec0134ebdc0869fab5e4bb28024c (diff)
parent8e34f647ee5db795e1ea46715de61cee63f4f4a7 (diff)
downloadrust-9bb8f88d3a79d3f8f10dca8cedf00cf57f6a94f6.tar.gz
rust-9bb8f88d3a79d3f8f10dca8cedf00cf57f6a94f6.zip
auto merge of #14696 : jakub-/rust/dead-struct-fields, r=alexcrichton
This uncovered some dead code, most notably in middle/liveness.rs, which I think suggests there must be something fishy with that part of the code.

The #[allow(dead_code)] annotations on some of the fields I am not super happy about but as I understand, marker type may disappear at some point.
Diffstat (limited to 'src/libnative')
-rw-r--r--src/libnative/io/c_win32.rs2
-rw-r--r--src/libnative/io/mod.rs4
-rw-r--r--src/libnative/io/net.rs5
-rw-r--r--src/libnative/io/pipe_unix.rs5
4 files changed, 12 insertions, 4 deletions
diff --git a/src/libnative/io/c_win32.rs b/src/libnative/io/c_win32.rs
index 1ec25933eec..e855b8bd4f2 100644
--- a/src/libnative/io/c_win32.rs
+++ b/src/libnative/io/c_win32.rs
@@ -20,6 +20,7 @@ pub static FIONBIO: libc::c_long = 0x8004667e;
 static FD_SETSIZE: uint = 64;
 pub static MSG_DONTWAIT: libc::c_int = 0;
 
+#[repr(C)]
 pub struct WSADATA {
     pub wVersion: libc::WORD,
     pub wHighVersion: libc::WORD,
@@ -32,6 +33,7 @@ pub struct WSADATA {
 
 pub type LPWSADATA = *mut WSADATA;
 
+#[repr(C)]
 pub struct fd_set {
     fd_count: libc::c_uint,
     fd_array: [libc::SOCKET, ..FD_SETSIZE],
diff --git a/src/libnative/io/mod.rs b/src/libnative/io/mod.rs
index 4c5929ef223..4158db7bb8e 100644
--- a/src/libnative/io/mod.rs
+++ b/src/libnative/io/mod.rs
@@ -152,13 +152,13 @@ fn keep_going(data: &[u8], f: |*u8, uint| -> i64) -> i64 {
 /// Implementation of rt::rtio's IoFactory trait to generate handles to the
 /// native I/O functionality.
 pub struct IoFactory {
-    cannot_construct_outside_of_this_module: ()
+    _cannot_construct_outside_of_this_module: ()
 }
 
 impl IoFactory {
     pub fn new() -> IoFactory {
         net::init();
-        IoFactory { cannot_construct_outside_of_this_module: () }
+        IoFactory { _cannot_construct_outside_of_this_module: () }
     }
 }
 
diff --git a/src/libnative/io/net.rs b/src/libnative/io/net.rs
index 24956e514ec..e7effbd6bdb 100644
--- a/src/libnative/io/net.rs
+++ b/src/libnative/io/net.rs
@@ -254,7 +254,10 @@ pub struct TcpStream {
 
 struct Inner {
     fd: sock_t,
-    lock: mutex::NativeMutex,
+
+    // Unused on Linux, where this lock is not necessary.
+    #[allow(dead_code)]
+    lock: mutex::NativeMutex
 }
 
 pub struct Guard<'a> {
diff --git a/src/libnative/io/pipe_unix.rs b/src/libnative/io/pipe_unix.rs
index 7a1134fbe59..1458b475ae9 100644
--- a/src/libnative/io/pipe_unix.rs
+++ b/src/libnative/io/pipe_unix.rs
@@ -58,7 +58,10 @@ fn addr_to_sockaddr_un(addr: &CString) -> IoResult<(libc::sockaddr_storage, uint
 
 struct Inner {
     fd: fd_t,
-    lock: mutex::NativeMutex,
+
+    // Unused on Linux, where this lock is not necessary.
+    #[allow(dead_code)]
+    lock: mutex::NativeMutex
 }
 
 impl Inner {