Crate rustc_version_const

Crate rustc_version_const 

Source
Expand description

§rustc-version-const

Makes the current rustc version available via a const fn at runtime.

The version detection happens automatically at build-time.

§Usage

Here is a simple example that demonstrates how to use rustc_version() in your code:

use rustc_version_const::{rustc_version, rustc_version_full};

const RUSTC_VERSION: &str = rustc_version();

fn main() {
   println!("rustc version: \"{}\"", RUSTC_VERSION);
}

Functions§

rustc_version
Returns the rustc version that was used to build this application
rustc_version_full
Returns the rustc version that was used to build this application