Skip to content

Commit 1875f22

Browse files
emberianPaul Osborne
authored andcommitted
Update some stuff for upstream bitflags changes
1 parent c6a4a87 commit 1875f22

File tree

5 files changed

+5
-268
lines changed

5 files changed

+5
-268
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ execvpe = []
2020

2121
[dependencies]
2222
libc = "0.1.8"
23-
bitflags = "0.1.1"
23+
bitflags = "0.3.2"
2424

2525
[dev-dependencies]
2626
rand = "0.3.8"

src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
#![crate_name = "nix"]
66
#![cfg(unix)]
77
#![allow(non_camel_case_types)]
8+
// latest bitflags triggers a rustc bug with cross-crate macro expansions causing dead_code
9+
// warnings even though the macro expands into something with allow(dead_code)
10+
#![allow(dead_code)]
811
#![deny(warnings)]
912

1013
#[macro_use]

src/sys/epoll.rs

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use {Error, Result, from_ffi};
22
use errno::Errno;
33
use libc::c_int;
4-
use std::fmt;
54
use std::os::unix::io::RawFd;
65

76
mod ffi {
@@ -35,41 +34,6 @@ bitflags!(
3534
}
3635
);
3736

38-
impl fmt::Debug for EpollEventKind {
39-
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
40-
let variants = [
41-
(EPOLLIN, "EPOLLIN"),
42-
(EPOLLPRI, "EPOLLPRI"),
43-
(EPOLLOUT, "EPOLLOUT"),
44-
(EPOLLRDNORM, "EPOLLRDNORM"),
45-
(EPOLLRDBAND, "EPOLLRDBAND"),
46-
(EPOLLWRNORM, "EPOLLWRNORM"),
47-
(EPOLLWRBAND, "EPOLLWRBAND"),
48-
(EPOLLMSG, "EPOLLMSG"),
49-
(EPOLLERR, "EPOLLERR"),
50-
(EPOLLHUP, "EPOLLHUP"),
51-
(EPOLLRDHUP, "EPOLLRDHUP"),
52-
(EPOLLWAKEUP, "EPOLLWAKEUP"),
53-
(EPOLLONESHOT, "EPOLLONESHOT"),
54-
(EPOLLET, "EPOLLET")];
55-
56-
let mut first = true;
57-
58-
for &(val, name) in variants.iter() {
59-
if self.contains(val) {
60-
if first {
61-
first = false;
62-
try!(write!(fmt, "{}", name));
63-
} else {
64-
try!(write!(fmt, "|{}", name));
65-
}
66-
}
67-
}
68-
69-
Ok(())
70-
}
71-
}
72-
7337
#[derive(Clone, Copy)]
7438
#[repr(C)]
7539
pub enum EpollOp {

src/sys/ioctl.rs

Lines changed: 0 additions & 224 deletions
This file was deleted.

src/sys/stat.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pub use libc::stat as FileStat;
44
use {Error, Result, NixPath, from_ffi};
55
use errno::Errno;
66
use libc::mode_t;
7-
use std::{fmt, mem};
7+
use std::mem;
88
use std::os::unix::io::RawFd;
99

1010
mod ffi {
@@ -50,12 +50,6 @@ bitflags! {
5050
}
5151
}
5252

53-
impl fmt::Debug for SFlag {
54-
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
55-
write!(fmt, "SFlag {{ bits: {} }}", self.bits())
56-
}
57-
}
58-
5953
pub fn mknod<P: ?Sized + NixPath>(path: &P, kind: SFlag, perm: Mode, dev: dev_t) -> Result<()> {
6054
let res = try!(path.with_nix_path(|cstr| {
6155
unsafe {

0 commit comments

Comments
 (0)