rustc-version-const 1.1.0

Provides the rustc version as a const function at runtime (detected at build-time)
Documentation

rustc-version-const

no_std Crates.io Downloads Release Date Docs.rs License

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

The version detection happens automatically at build-time.

This crate is #![no_std] and does not require any additional dependencies.

Installation

In order to use this crate, you have to add it under [dependencies] to your Cargo.toml:

[dependencies]
rustc-version-const = "1.0.0"

Usage

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

use rustc_version_const::rustc_version;

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

License

This software is released under the BSD Zero Clause (“0BSD”) License.

Copyright (C) 2025 by LoRd_MuldeR <mulder2@gmx.de>.