Skip to content

Commit 99d6a00

Browse files
committed
libc: re-export libc properly
With rust 1.7, the following warning was being emitted by the compiler: warning: `pub extern crate` does not work as expected and should not be used. Likely to become an error. Prefer `extern crate` and `pub use`. Based on rust-lang/rust#26775 it appears that this change is the current best approach for properly exporting the libc dependency so it may be used outside of nix. Signed-off-by: Paul Osborne <[email protected]>
1 parent 5bac9df commit 99d6a00

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@
1313
#[macro_use]
1414
extern crate bitflags;
1515

16-
pub extern crate libc;
17-
1816
#[cfg(test)]
1917
extern crate nix_test as nixtest;
2018

19+
mod exports {
20+
extern crate libc;
21+
}
22+
2123
// Re-exports
24+
pub use exports::libc;
2225
pub use libc::{c_int, c_void};
2326
pub use errno::Errno;
2427

0 commit comments

Comments
 (0)