rustc-version-const 1.1.0

Provides the rustc version as a const function at runtime (detected at build-time)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
// SPDX-License-Identifier: 0BSD
// rustc-version-const
// Copyright (C) 2025 by LoRd_MuldeR <mulder2@gmx.de>

use rustc_version_const::{rustc_version, rustc_version_full};

const RUSTC_VERSION: &str = rustc_version();
const RUSTC_VERSION_FULL: &str = rustc_version_full();

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