rustc-version-const 1.1.0

Provides the rustc version as a const function at runtime (detected at build-time)
Documentation
  • Coverage
  • 75%
    3 out of 4 items documented1 out of 3 items with examples
  • Size
  • Source code size: 7.32 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 583.37 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 13s Average build duration of successful builds.
  • all releases: 13s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • lordmulder/rustc-version-const
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • lordmulder

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>.