diff --git a/tfhe/src/high_level_api/compressed_ciphertext_list.rs b/tfhe/src/high_level_api/compressed_ciphertext_list.rs index 156bffbdf7..7492a134ad 100644 --- a/tfhe/src/high_level_api/compressed_ciphertext_list.rs +++ b/tfhe/src/high_level_api/compressed_ciphertext_list.rs @@ -213,12 +213,6 @@ pub(crate) enum InnerCompressedCiphertextList { Cuda(crate::integer::gpu::ciphertext::compressed_ciphertext_list::CudaCompressedCiphertextList), } -#[derive(serde::Serialize, serde::Deserialize)] -#[cfg_attr(tfhe_lints, allow(tfhe_lints::serialize_without_versionize))] -pub(crate) struct InnerCompressedCiphertextListVersionOwned( - ::VersionedOwned, -); - impl Versionize for InnerCompressedCiphertextList { type Versioned<'vers> = ::VersionedOwned; diff --git a/tfhe/src/shortint/wopbs/mod.rs b/tfhe/src/shortint/wopbs/mod.rs index 0434d3238d..c218738078 100644 --- a/tfhe/src/shortint/wopbs/mod.rs +++ b/tfhe/src/shortint/wopbs/mod.rs @@ -17,6 +17,7 @@ mod test; // Struct for WoPBS based on the private functional packing keyswitch. #[derive(Clone, Debug, Serialize, Deserialize)] +#[cfg_attr(tfhe_lints, allow(tfhe_lints::serialize_without_versionize))] pub struct WopbsKey { //Key for the private functional keyswitch pub wopbs_server_key: ServerKey, diff --git a/utils/cargo-tfhe-lints-inner/src/main.rs b/utils/cargo-tfhe-lints-inner/src/main.rs index d4b35995d2..c166ed1e19 100644 --- a/utils/cargo-tfhe-lints-inner/src/main.rs +++ b/utils/cargo-tfhe-lints-inner/src/main.rs @@ -27,6 +27,11 @@ fn main() { (tool_args.as_slice(), &[] as &[String]) }; + // The linter calls rustc without cargo, so these variables won't be set. Since we use them in + // our code, we need to set them to any value to avoid a compilation error. + std::env::set_var("CARGO_PKG_VERSION_MAJOR", "X"); + std::env::set_var("CARGO_PKG_VERSION_MINOR", "Y"); + rustc_tools::cargo_integration(&cargo_args, |args| { let mut args = args.to_vec(); args.extend(rustc_args.iter().skip(1).cloned()); diff --git a/utils/cargo-tfhe-lints/src/main.rs b/utils/cargo-tfhe-lints/src/main.rs index 47bdc57e40..90fa9ac472 100644 --- a/utils/cargo-tfhe-lints/src/main.rs +++ b/utils/cargo-tfhe-lints/src/main.rs @@ -1,4 +1,7 @@ -use std::process::{exit, Command}; +use std::{ + io::{Error, ErrorKind}, + process::{exit, Command}, +}; fn get_supported_rustc_version() -> &'static str { const TOOLCHAIN_FILE: &str = include_str!("../../cargo-tfhe-lints-inner/rust-toolchain.toml"); @@ -26,8 +29,17 @@ fn main() { .arg(toolchain.as_str()) .arg("tfhe-lints-inner") .args(&cargo_args) - .spawn() - .and_then(|mut child| child.wait()) + .status() + .and_then(|res| { + if !res.success() { + Err(Error::new( + ErrorKind::Other, + format!("Inner process failed with {res}"), + )) + } else { + Ok(()) + } + }) { eprintln!( "Command `cargo {toolchain} tfhe-lints-inner {}` failed: {err:?}",