Skip to content

Commit

Permalink
Fail to compile for any unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryant Mairs committed Jan 15, 2018
1 parent 258461c commit 9b99ebc
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]

Expand Down
10 changes: 5 additions & 5 deletions src/sys/aio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub struct AioCb<'a> {
/// Could this `AioCb` potentially have any in-kernel state?
in_progress: bool,
/// Used to keep buffers from Drop'ing
keeper: Keeper<'a>
_keeper: Keeper<'a>
}

impl<'a> AioCb<'a> {
Expand Down Expand Up @@ -115,7 +115,7 @@ impl<'a> AioCb<'a> {
aiocb: a,
mutable: false,
in_progress: false,
keeper: Keeper::none
_keeper: Keeper::none
}
}

Expand Down Expand Up @@ -143,7 +143,7 @@ impl<'a> AioCb<'a> {
aiocb: a,
mutable: true,
in_progress: false,
keeper: Keeper::phantom(PhantomData)
_keeper: Keeper::phantom(PhantomData)
}
}

Expand Down Expand Up @@ -174,7 +174,7 @@ impl<'a> AioCb<'a> {
aiocb: a,
mutable: true,
in_progress: false,
keeper: Keeper::boxed(buf)
_keeper: Keeper::boxed(buf)
}
}

Expand Down Expand Up @@ -208,7 +208,7 @@ impl<'a> AioCb<'a> {
aiocb: a,
mutable: false,
in_progress: false,
keeper: Keeper::none
_keeper: Keeper::none
}
}

Expand Down
6 changes: 5 additions & 1 deletion src/sys/mman.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
3 changes: 0 additions & 3 deletions src/sys/quota.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ libc_enum!{
Q_SYNC,
Q_QUOTAON,
Q_QUOTAOFF,
Q_GETFMT,
Q_GETINFO,
Q_SETINFO,
Q_GETQUOTA,
Q_SETQUOTA,
}
Expand Down
4 changes: 3 additions & 1 deletion src/sys/wait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 9b99ebc

Please sign in to comment.