Debian Codegraph @

build.rs

raw symbols SCIP
1 use rustc_version::{version_meta, Version};
2
3 fn main() {
4 let version_meta = version_meta().expect("Could not get Rust version");
5
6 let rustc_version = version_meta.semver;
7 let trimmed_rustc_version = Version::new(
8 rustc_version.major,
9 rustc_version.minor,
10 rustc_version.patch,
11 );
12
13 // Add cfg flag for Rust >= 1.82
14 // Required for precise capturing in edition 2024
15 // Due to changes in lifetime and type capture behavior for impl trait
16 // see: https://github.com/maciejhirsz/logos/issues/434, https://github.com/rust-lang/rfcs/pull/3498
17 println!("cargo:rustc-check-cfg=cfg(rust_1_82)");
18 if trimmed_rustc_version >= Version::new(1, 82, 0) {
19 println!("cargo:rustc-cfg=rust_1_82");
20 }
21 }