diff options
| author | mo khan <mo@mokhan.ca> | 2025-07-02 18:36:06 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-07-02 18:36:06 -0600 |
| commit | 8cdfa445d6629ffef4cb84967ff7017654045bc2 (patch) | |
| tree | 22f0b0907c024c78d26a731e2e1f5219407d8102 /vendor/logos-codegen/build.rs | |
| parent | 4351c74c7c5f97156bc94d3a8549b9940ac80e3f (diff) | |
chore: add vendor directory
Diffstat (limited to 'vendor/logos-codegen/build.rs')
| -rw-r--r-- | vendor/logos-codegen/build.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/vendor/logos-codegen/build.rs b/vendor/logos-codegen/build.rs new file mode 100644 index 00000000..f11a575f --- /dev/null +++ b/vendor/logos-codegen/build.rs @@ -0,0 +1,21 @@ +use rustc_version::{version_meta, Version}; + +fn main() { + let version_meta = version_meta().expect("Could not get Rust version"); + + let rustc_version = version_meta.semver; + let trimmed_rustc_version = Version::new( + rustc_version.major, + rustc_version.minor, + rustc_version.patch, + ); + + // Add cfg flag for Rust >= 1.82 + // Required for precise capturing in edition 2024 + // Due to changes in lifetime and type capture behavior for impl trait + // see: https://github.com/maciejhirsz/logos/issues/434, https://github.com/rust-lang/rfcs/pull/3498 + println!("cargo:rustc-check-cfg=cfg(rust_1_82)"); + if trimmed_rustc_version >= Version::new(1, 82, 0) { + println!("cargo:rustc-cfg=rust_1_82"); + } +} |
