Sha256: 626c9fc3a055a6b64b6cf85f5aad1b22c9f6a49f9ff163316fa8dac3b34aef75
Contents?: true
Size: 756 Bytes
Versions: 13
Compression:
Stored size: 756 Bytes
Contents
use std::env; use std::process::Command; use std::str; fn main() { println!("cargo:rerun-if-changed=build.rs"); let compiler = match rustc_minor_version() { Some(compiler) => compiler, None => return, }; if compiler < 45 { println!("cargo:rustc-cfg=no_span_mixed_site"); } if compiler < 47 { println!("cargo:rustc-cfg=self_span_hack"); } } fn rustc_minor_version() -> Option<u32> { let rustc = env::var_os("RUSTC")?; let output = Command::new(rustc).arg("--version").output().ok()?; let version = str::from_utf8(&output.stdout).ok()?; let mut pieces = version.split('.'); if pieces.next() != Some("rustc 1") { return None; } pieces.next()?.parse().ok() }
Version data entries
13 entries across 13 versions & 1 rubygems