summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryant Mairs <bryantmairs@google.com>2018-01-14 16:32:34 -0800
committerBryant Mairs <bryantmairs@google.com>2018-01-28 17:39:47 -0800
commit3406b1bd921e71339f975591260b330175e58797 (patch)
treef72ecd38d6d4be7cdb929049bdcf9dacf52822c1
parent65e5cf4f5b357ce50723748152db716a71a719b2 (diff)
downloadnix-3406b1bd921e71339f975591260b330175e58797.zip
Fail to compile for any unused code
-rw-r--r--src/lib.rs3
-rw-r--r--src/sys/aio.rs8
-rw-r--r--src/sys/mman.rs6
-rw-r--r--src/sys/quota.rs3
-rw-r--r--src/sys/wait.rs4
5 files changed, 13 insertions, 11 deletions
diff --git a/src/lib.rs b/src/lib.rs
index e3ce81b8..effb31de 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -10,9 +10,8 @@
#![allow(dead_code)]
#![cfg_attr(test, deny(warnings))]
#![recursion_limit = "500"]
-#![deny(unused_qualifications)]
+#![deny(unused)]
#![deny(unstable_features)]
-#![deny(unused_import_braces)]
#![deny(missing_copy_implementations)]
#![deny(missing_debug_implementations)]
diff --git a/src/sys/aio.rs b/src/sys/aio.rs
index d5561e9c..fe8e9ed2 100644
--- a/src/sys/aio.rs
+++ b/src/sys/aio.rs
@@ -295,7 +295,7 @@ impl<'a> AioCb<'a> {
aiocb: a,
mutable: true,
in_progress: false,
- buffer: Buffer::Phantom(PhantomData)
+ buffer: Buffer::Phantom(PhantomData),
}
}
@@ -379,7 +379,7 @@ impl<'a> AioCb<'a> {
aiocb: a,
mutable: false,
in_progress: false,
- buffer: Buffer::Bytes(buf2)
+ buffer: Buffer::Bytes(buf2),
}
}
@@ -464,7 +464,7 @@ impl<'a> AioCb<'a> {
aiocb: a,
mutable: true,
in_progress: false,
- buffer: Buffer::BytesMut(buf2)
+ buffer: Buffer::BytesMut(buf2),
}
}
@@ -619,7 +619,7 @@ impl<'a> AioCb<'a> {
aiocb: a,
mutable: false,
in_progress: false,
- buffer: Buffer::None
+ buffer: Buffer::None,
}
}
diff --git a/src/sys/mman.rs b/src/sys/mman.rs
index 5b4bd4f5..9d1f88df 100644
--- a/src/sys/mman.rs
+++ b/src/sys/mman.rs
@@ -1,7 +1,11 @@
-use {Error, Result, NixPath};
+use {Error, Result};
+#[cfg(not(target_os = "android"))]
+use NixPath;
use errno::Errno;
+#[cfg(not(target_os = "android"))]
use fcntl::OFlag;
use libc::{self, c_int, c_void, size_t, off_t};
+#[cfg(not(target_os = "android"))]
use sys::stat::Mode;
use std::os::unix::io::RawFd;
diff --git a/src/sys/quota.rs b/src/sys/quota.rs
index 6d8e6267..b4cac1dc 100644
--- a/src/sys/quota.rs
+++ b/src/sys/quota.rs
@@ -33,9 +33,6 @@ libc_enum!{
Q_SYNC,
Q_QUOTAON,
Q_QUOTAOFF,
- Q_GETFMT,
- Q_GETINFO,
- Q_SETINFO,
Q_GETQUOTA,
Q_SETQUOTA,
}
diff --git a/src/sys/wait.rs b/src/sys/wait.rs
index 53c6a5f2..038354b1 100644
--- a/src/sys/wait.rs
+++ b/src/sys/wait.rs
@@ -141,6 +141,7 @@ fn stop_signal(status: i32) -> Result<Signal> {
Signal::from_c_int(unsafe { libc::WSTOPSIG(status) })
}
+#[cfg(any(target_os = "android", target_os = "linux"))]
fn syscall_stop(status: i32) -> bool {
// From ptrace(2), setting PTRACE_O_TRACESYSGOOD has the effect
// of delivering SIGTRAP | 0x80 as the signal number for syscall
@@ -149,6 +150,7 @@ fn syscall_stop(status: i32) -> bool {
unsafe { libc::WSTOPSIG(status) == libc::SIGTRAP | 0x80 }
}
+#[cfg(any(target_os = "android", target_os = "linux"))]
fn stop_additional(status: i32) -> c_int {
(status >> 16) as c_int
}
@@ -182,7 +184,7 @@ impl WaitStatus {
WaitStatus::Signaled(pid, try!(term_signal(status)), dumped_core(status))
} else if stopped(status) {
cfg_if! {
- if #[cfg(any(target_os = "linux", target_os = "android"))] {
+ if #[cfg(any(target_os = "android", target_os = "linux"))] {
fn decode_stopped(pid: Pid, status: i32) -> Result<WaitStatus> {
let status_additional = stop_additional(status);
Ok(if syscall_stop(status) {