Static dusk_api::RUSTC_VERSION[][src]

pub static RUSTC_VERSION: &str

Rust compiler version parameter, passed from the compiler.

If plugin is compiled with a different rust compiler version it may be incompatible with the program using it, so before proceeding to use the plugin a version check is needed.

for this to work, build script should set this environmental variable, which can be done like this

build.rs

extern crate rustc_version;

fn main() {
    let version = rustc_version::version().unwrap();
    println!("cargo:rustc-env=RUSTC_VERSION={}", version);
}

Cargo.toml

[build-dependencies]
rustc_version = "0.3.0"