fix: remove unused rustc_version dependency and simplify build.rs

- Remove rustc_version build dependency that was no longer needed
- Remove nightly detection since nightly cfg flag wasn't used anywhere
- Simplify build.rs to only set track_caller cfg flag
This commit is contained in:
François Garillot 2025-11-19 09:12:01 -05:00
parent 9af0988e52
commit 9bdf23a659
No known key found for this signature in database
GPG Key ID: E7645C6B883A1E9A
2 changed files with 0 additions and 9 deletions

View File

@ -42,8 +42,6 @@ serde = { version = "1.0.196", features = ["derive"] }
serde_json = "1.0.113" serde_json = "1.0.113"
strip-ansi-escapes = "0.2.0" strip-ansi-escapes = "0.2.0"
[build-dependencies]
rustc_version = "0.2"
[features] [features]
default = ["derive", "std"] default = ["derive", "std"]

View File

@ -1,15 +1,8 @@
use rustc_version::{version_meta, Channel};
fn main() { fn main() {
if let Channel::Nightly = version_meta().unwrap().channel {
println!("cargo:rustc-cfg=nightly")
}
// track_caller is stable since Rust 1.46 (2020), so no version check needed // track_caller is stable since Rust 1.46 (2020), so no version check needed
println!("cargo:rustc-cfg=track_caller"); println!("cargo:rustc-cfg=track_caller");
// Add check-cfg for conditional configurations // Add check-cfg for conditional configurations
println!("cargo:rustc-check-cfg=cfg(doc_cfg)"); println!("cargo:rustc-check-cfg=cfg(doc_cfg)");
println!("cargo:rustc-check-cfg=cfg(track_caller)"); println!("cargo:rustc-check-cfg=cfg(track_caller)");
println!("cargo:rustc-check-cfg=cfg(nightly)");
} }