From 8bfc52c3abc3729271d6bbeb1bd7a6b2d03d0e74 Mon Sep 17 00:00:00 2001 From: Trevor Spiteri Date: Sat, 2 Feb 2019 20:20:53 +0100 Subject: [PATCH] remove repr(transparent) check from build.rs --- build.rs | 22 ++++++---------------- src/lib.rs | 1 - 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/build.rs b/build.rs index 2398eb8..0c34fa6 100644 --- a/build.rs +++ b/build.rs @@ -5,6 +5,9 @@ // the copyright notice and this notice are preserved. This file is // offered as-is, without any warranty. +#![allow(dead_code)] +#![allow(unused_variables)] + use std::env; use std::ffi::OsString; use std::fs::{self, File}; @@ -22,12 +25,7 @@ fn main() { out_dir: PathBuf::from(cargo_env("OUT_DIR")), rustc: cargo_env("RUSTC"), }; - env.check_feature( - "repr_transparent", - Optional(false), - TRY_REPR_TRANSPARENT, - Some("repr_transparent"), - ); + // env.check_feature(...); } #[derive(PartialEq)] @@ -37,7 +35,7 @@ impl Environment { // 1. If optional feature is availble (both with and without flag), output: // cargo:rustc-cfg= // 2. If feature is available with flag (both optional and not), output: - // cargo:rustc-cfg_nightly= + // cargo:rustc-cfg=nightly_ // 3. If non-optional feature is not available, panic. fn check_feature( &self, @@ -78,7 +76,7 @@ impl Environment { .status() .unwrap_or_else(|_| panic!("Unable to execute: {:?}", cmd)); if status.success() { - if !optional.0 { + if optional.0 { println!("cargo:rustc-cfg={}", name); } if *i == Iteration::Unstable { @@ -129,11 +127,3 @@ fn create_file_or_panic(filename: &Path, contents: &str) { file.write_all(contents.as_bytes()) .unwrap_or_else(|_| panic!("Unable to write to file: {:?}", filename)); } - -const TRY_REPR_TRANSPARENT: &str = r#"// try_repr_transparent.rs -#[repr(transparent)] -struct Foo(i32); -fn main() { - let _ = Foo(12); -} -"#; diff --git a/src/lib.rs b/src/lib.rs index b46a9c0..2b54917 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -185,7 +185,6 @@ additional terms or conditions. #![warn(missing_docs)] #![doc(html_root_url = "https://docs.rs/fixed/0.2.1")] #![doc(test(attr(deny(warnings))))] -#![cfg_attr(nightly_repr_transparent, feature(repr_transparent))] #![cfg_attr(feature = "fail-on-warnings", deny(warnings))] #[cfg(feature = "f16")]