Skip to content

Commit 3406b1b

Browse files
author
Bryant Mairs
committed
Fail to compile for any unused code
1 parent 65e5cf4 commit 3406b1b

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
lines changed

src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@
1010
#![allow(dead_code)]
1111
#![cfg_attr(test, deny(warnings))]
1212
#![recursion_limit = "500"]
13-
#![deny(unused_qualifications)]
13+
#![deny(unused)]
1414
#![deny(unstable_features)]
15-
#![deny(unused_import_braces)]
1615
#![deny(missing_copy_implementations)]
1716
#![deny(missing_debug_implementations)]
1817

src/sys/aio.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ impl<'a> AioCb<'a> {
295295
aiocb: a,
296296
mutable: true,
297297
in_progress: false,
298-
buffer: Buffer::Phantom(PhantomData)
298+
buffer: Buffer::Phantom(PhantomData),
299299
}
300300
}
301301

@@ -379,7 +379,7 @@ impl<'a> AioCb<'a> {
379379
aiocb: a,
380380
mutable: false,
381381
in_progress: false,
382-
buffer: Buffer::Bytes(buf2)
382+
buffer: Buffer::Bytes(buf2),
383383
}
384384
}
385385

@@ -464,7 +464,7 @@ impl<'a> AioCb<'a> {
464464
aiocb: a,
465465
mutable: true,
466466
in_progress: false,
467-
buffer: Buffer::BytesMut(buf2)
467+
buffer: Buffer::BytesMut(buf2),
468468
}
469469
}
470470

@@ -619,7 +619,7 @@ impl<'a> AioCb<'a> {
619619
aiocb: a,
620620
mutable: false,
621621
in_progress: false,
622-
buffer: Buffer::None
622+
buffer: Buffer::None,
623623
}
624624
}
625625

src/sys/mman.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
use {Error, Result, NixPath};
1+
use {Error, Result};
2+
#[cfg(not(target_os = "android"))]
3+
use NixPath;
24
use errno::Errno;
5+
#[cfg(not(target_os = "android"))]
36
use fcntl::OFlag;
47
use libc::{self, c_int, c_void, size_t, off_t};
8+
#[cfg(not(target_os = "android"))]
59
use sys::stat::Mode;
610
use std::os::unix::io::RawFd;
711

src/sys/quota.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ libc_enum!{
3333
Q_SYNC,
3434
Q_QUOTAON,
3535
Q_QUOTAOFF,
36-
Q_GETFMT,
37-
Q_GETINFO,
38-
Q_SETINFO,
3936
Q_GETQUOTA,
4037
Q_SETQUOTA,
4138
}

src/sys/wait.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ fn stop_signal(status: i32) -> Result<Signal> {
141141
Signal::from_c_int(unsafe { libc::WSTOPSIG(status) })
142142
}
143143

144+
#[cfg(any(target_os = "android", target_os = "linux"))]
144145
fn syscall_stop(status: i32) -> bool {
145146
// From ptrace(2), setting PTRACE_O_TRACESYSGOOD has the effect
146147
// of delivering SIGTRAP | 0x80 as the signal number for syscall
@@ -149,6 +150,7 @@ fn syscall_stop(status: i32) -> bool {
149150
unsafe { libc::WSTOPSIG(status) == libc::SIGTRAP | 0x80 }
150151
}
151152

153+
#[cfg(any(target_os = "android", target_os = "linux"))]
152154
fn stop_additional(status: i32) -> c_int {
153155
(status >> 16) as c_int
154156
}
@@ -182,7 +184,7 @@ impl WaitStatus {
182184
WaitStatus::Signaled(pid, try!(term_signal(status)), dumped_core(status))
183185
} else if stopped(status) {
184186
cfg_if! {
185-
if #[cfg(any(target_os = "linux", target_os = "android"))] {
187+
if #[cfg(any(target_os = "android", target_os = "linux"))] {
186188
fn decode_stopped(pid: Pid, status: i32) -> Result<WaitStatus> {
187189
let status_additional = stop_additional(status);
188190
Ok(if syscall_stop(status) {

0 commit comments

Comments
 (0)