| Crates.io | rustc-version-const |
| lib.rs | rustc-version-const |
| version | 1.1.0 |
| created_at | 2025-10-14 13:37:41.718948+00 |
| updated_at | 2025-10-24 22:23:33.218734+00 |
| description | Provides the rustc version as a const function at runtime (detected at build-time) |
| homepage | |
| repository | https://github.com/lordmulder/rustc-version-const |
| max_upload_size | |
| id | 1882261 |
| size | 7,790 |
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.
In order to use this crate, you have to add it under [dependencies] to your Cargo.toml:
[dependencies]
rustc-version-const = "1.0.0"
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());
}
This software is released under the BSD Zero Clause (“0BSD”) License.
Copyright (C) 2025 by LoRd_MuldeR <mulder2@gmx.de>.