From 761245169b9649e9f351ba7782ca6579acf7bb6b Mon Sep 17 00:00:00 2001 From: Khyber Sen Date: Sat, 18 Oct 2025 18:14:40 -0700 Subject: [PATCH 1/2] transpile: update dependencies in generated `Cargo.toml` --- c2rust-transpile/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/c2rust-transpile/src/lib.rs b/c2rust-transpile/src/lib.rs index 8aaa546e56..457ffc4aa4 100644 --- a/c2rust-transpile/src/lib.rs +++ b/c2rust-transpile/src/lib.rs @@ -182,8 +182,8 @@ impl ExternCrateDetails { impl From for ExternCrateDetails { fn from(extern_crate: ExternCrate) -> Self { match extern_crate { - ExternCrate::C2RustBitfields => Self::new("c2rust-bitfields", "0.3", true), - ExternCrate::C2RustAsmCasts => Self::new("c2rust-asm-casts", "0.2", true), + ExternCrate::C2RustBitfields => Self::new("c2rust-bitfields", "0.21", true), + ExternCrate::C2RustAsmCasts => Self::new("c2rust-asm-casts", "0.21", true), ExternCrate::F128 => Self::new("f128", "0.2", false), ExternCrate::NumTraits => Self::new("num-traits", "0.2", true), ExternCrate::Memoffset => Self::new("memoffset", "0.5", true), From d5810d23d0d3af72d57875cee349153a8bb9b6d3 Mon Sep 17 00:00:00 2001 From: Khyber Sen Date: Wed, 22 Oct 2025 22:32:28 -0700 Subject: [PATCH 2/2] transpile: use `env!("CARGO_PKG_VERSION")` instead of hardcoding `0.21` to ensure we stay in sync --- c2rust-transpile/src/lib.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/c2rust-transpile/src/lib.rs b/c2rust-transpile/src/lib.rs index 457ffc4aa4..e94ab9ecb8 100644 --- a/c2rust-transpile/src/lib.rs +++ b/c2rust-transpile/src/lib.rs @@ -182,8 +182,12 @@ impl ExternCrateDetails { impl From for ExternCrateDetails { fn from(extern_crate: ExternCrate) -> Self { match extern_crate { - ExternCrate::C2RustBitfields => Self::new("c2rust-bitfields", "0.21", true), - ExternCrate::C2RustAsmCasts => Self::new("c2rust-asm-casts", "0.21", true), + ExternCrate::C2RustBitfields => { + Self::new("c2rust-bitfields", env!("CARGO_PKG_VERSION"), true) + } + ExternCrate::C2RustAsmCasts => { + Self::new("c2rust-asm-casts", env!("CARGO_PKG_VERSION"), true) + } ExternCrate::F128 => Self::new("f128", "0.2", false), ExternCrate::NumTraits => Self::new("num-traits", "0.2", true), ExternCrate::Memoffset => Self::new("memoffset", "0.5", true),