Skip to content

Commit

Permalink
Auto merge of rust-lang#340 - kamalmarhubi:allow-raw-pointer-derive-w…
Browse files Browse the repository at this point in the history
…arning, r=posborne

Fix raw_pointer_derive warning

This commit adds a small build script to detect if we need to
`#[allow(raw_pointer_derive)]` and makes the attribute conditional.

Refs rust-lang#337
  • Loading branch information
homu committed Apr 2, 2016
2 parents 4ca407d + 7c9524c commit 7743599
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ exclude = [
"test/**/*"
]

build = "build.rs"

[features]
eventfd = []
execvpe = []
Expand All @@ -24,6 +26,10 @@ libc = "0.2.8"
bitflags = "0.4"
cfg-if = "0.1.0"

[build-dependencies]
rustc_version = "0.1.7"
semver = "0.1.20" # Old version for compatibility with rustc_version.

[dev-dependencies]
rand = "0.3.8"
tempdir = "0.3"
Expand Down
10 changes: 10 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
extern crate rustc_version;
extern crate semver;

use semver::Version;

fn main() {
if rustc_version::version() >= Version::parse("1.6.0").unwrap() {
println!("cargo:rustc-cfg=raw_pointer_derive_allowed");
}
}
2 changes: 1 addition & 1 deletion src/sys/signal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ impl AsRef<libc::sigset_t> for SigSet {
}

#[allow(unknown_lints)]
#[allow(raw_pointer_derive)]
#[cfg_attr(not(raw_pointer_derive_allowed), allow(raw_pointer_derive))]
#[derive(Clone, Copy, PartialEq)]
pub enum SigHandler {
SigDfl,
Expand Down

0 comments on commit 7743599

Please sign in to comment.