| 1 | use rustc_versionrust-analyzer cargo rustc_version 0.4.1 crate/::{version_metarust-analyzer cargo rustc_version 0.4.1 version_meta()., Versionrust-analyzer cargo semver 1.0.26 Version#}; |
| 2 | |
| 3 | fn mainrust-analyzer cargo logos-codegen 0.15.1 main().() { |
| 4 | let version_meta = version_metarust-analyzer cargo rustc_version 0.4.1 version_meta().().expectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]expect().("Could not get Rust version"); |
| 5 | |
| 6 | let rustc_version = version_meta.semverrust-analyzer cargo rustc_version 0.4.1 VersionMeta#semver.; |
| 7 | let trimmed_rustc_version = Versionrust-analyzer cargo semver 1.0.26 Version#::newrust-analyzer cargo semver 1.0.26 impl#[Version]new().( |
| 8 | rustc_version.majorrust-analyzer cargo semver 1.0.26 Version#major., |
| 9 | rustc_version.minorrust-analyzer cargo semver 1.0.26 Version#minor., |
| 10 | rustc_version.patchrust-analyzer cargo semver 1.0.26 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 | printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("cargo:rustc-check-cfg=cfg(rust_1_82)"); |
| 18 | if trimmed_rustc_version rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd#ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd#ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd#ge().Versionrust-analyzer cargo semver 1.0.26 Version#::newrust-analyzer cargo semver 1.0.26 impl#[Version]new().(1, 82, 0) { |
| 19 | printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("cargo:rustc-cfg=rust_1_82"); |
| 20 | } |
| 21 | } |