]>
git.proxmox.com Git - rustc.git/blob - src/vendor/failure_derive/build.rs
2 use std
::process
::Command
;
7 if rustc_has_dyn_trait() {
8 println
!("cargo:rustc-cfg=has_dyn_trait");
12 fn rustc_has_dyn_trait() -> bool
{
13 let rustc
= match env
::var_os("RUSTC") {
18 let output
= match Command
::new(rustc
).arg("--version").output() {
20 Err(_
) => return false,
23 let version
= match str::from_utf8(&output
.stdout
) {
24 Ok(version
) => version
,
25 Err(_
) => return false,
28 let mut pieces
= version
.split('
.'
);
29 if pieces
.next() != Some("rustc 1") {
33 let next
= match pieces
.next() {
38 u32::from_str(next
).unwrap_or(0) >= 27