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

Version Path
wasmtime-13.0.0 ./ext/cargo-vendor/async-trait-0.1.73/build.rs
wasmtime-12.0.1 ./ext/cargo-vendor/async-trait-0.1.73/build.rs
wasmtime-12.0.0 ./ext/cargo-vendor/async-trait-0.1.73/build.rs
wasmtime-11.0.0 ./ext/cargo-vendor/async-trait-0.1.73/build.rs
wasmtime-10.0.1 ./ext/cargo-vendor/async-trait-0.1.72/build.rs
wasmtime-10.0.0 ./ext/cargo-vendor/async-trait-0.1.72/build.rs
wasmtime-9.0.4 ./ext/cargo-vendor/async-trait-0.1.72/build.rs
wasmtime-9.0.1 ./ext/cargo-vendor/async-trait-0.1.68/build.rs
wasmtime-8.0.0 ./ext/cargo-vendor/async-trait-0.1.68/build.rs
wasmtime-7.0.0 ./ext/cargo-vendor/async-trait-0.1.68/build.rs
wasmtime-6.0.1 ./ext/cargo-vendor/async-trait-0.1.64/build.rs
wasmtime-6.0.0 ./ext/cargo-vendor/async-trait-0.1.64/build.rs
wasmtime-5.0.0 ./ext/cargo-vendor/async-trait-0.1.62/build.rs