diff --git a/protobuf/build.rs b/protobuf/build.rs index 3494f0753..179184ac5 100644 --- a/protobuf/build.rs +++ b/protobuf/build.rs @@ -7,48 +7,6 @@ use std::path::Path; use std::path::PathBuf; use std::process; -// % rustc +stable --version -// rustc 1.26.0 (a77568041 2018-05-07) -// % rustc +beta --version -// rustc 1.27.0-beta.1 (03fb2f447 2018-05-09) -// % rustc +nightly --version -// rustc 1.27.0-nightly (acd3871ba 2018-05-10) -fn version_is_nightly(version: &str) -> bool { - version.contains("nightly") -} - -fn cfg_rust_version() { - let rustc = env::var("RUSTC").expect("RUSTC unset"); - let mut cmd = if let Some(wrapper) = env::var_os("RUSTC_WRAPPER").filter(|w| !w.is_empty()) { - let mut cmd = process::Command::new(wrapper); - cmd.arg(rustc); - cmd - } else { - process::Command::new(rustc) - }; - - let mut child = cmd - .args(&["--version"]) - .stdin(process::Stdio::null()) - .stdout(process::Stdio::piped()) - .spawn() - .expect("spawn rustc"); - - let mut rustc_version = String::new(); - - child - .stdout - .as_mut() - .expect("stdout") - .read_to_string(&mut rustc_version) - .expect("read_to_string"); - assert!(child.wait().expect("wait").success()); - - if version_is_nightly(&rustc_version) { - println!("cargo:rustc-cfg=rustc_nightly"); - } -} - fn cfg_serde() { match env::var("CARGO_FEATURE_WITH_SERDE") { Ok(_) => {