Skip to content

Commit 481a649

Browse files
author
Bryant Mairs
committed
Fail to compile for any unused code
1 parent 4b5c9b0 commit 481a649

File tree

5 files changed

+14
-12
lines changed

5 files changed

+14
-12
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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ pub struct AioCb<'a> {
8686
/// Could this `AioCb` potentially have any in-kernel state?
8787
in_progress: bool,
8888
/// Used to keep buffers from Drop'ing
89-
keeper: Keeper<'a>
89+
_keeper: Keeper<'a>
9090
}
9191

9292
impl<'a> AioCb<'a> {
@@ -115,7 +115,7 @@ impl<'a> AioCb<'a> {
115115
aiocb: a,
116116
mutable: false,
117117
in_progress: false,
118-
keeper: Keeper::none
118+
_keeper: Keeper::none
119119
}
120120
}
121121

@@ -143,7 +143,7 @@ impl<'a> AioCb<'a> {
143143
aiocb: a,
144144
mutable: true,
145145
in_progress: false,
146-
keeper: Keeper::phantom(PhantomData)
146+
_keeper: Keeper::phantom(PhantomData)
147147
}
148148
}
149149

@@ -174,7 +174,7 @@ impl<'a> AioCb<'a> {
174174
aiocb: a,
175175
mutable: true,
176176
in_progress: false,
177-
keeper: Keeper::boxed(buf)
177+
_keeper: Keeper::boxed(buf)
178178
}
179179
}
180180

@@ -208,7 +208,7 @@ impl<'a> AioCb<'a> {
208208
aiocb: a,
209209
mutable: false,
210210
in_progress: false,
211-
keeper: Keeper::none
211+
_keeper: Keeper::none
212212
}
213213
}
214214

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)