diff --git a/apps/trivium/src/kreyvium/test.rs b/apps/trivium/src/kreyvium/test.rs index af7b18f4b..fa9a1e2b9 100644 --- a/apps/trivium/src/kreyvium/test.rs +++ b/apps/trivium/src/kreyvium/test.rs @@ -66,7 +66,7 @@ fn get_hexagonal_string_from_bytes(a: Vec) -> String { assert!(a.len() % 8 == 0); let mut hexadecimal: String = "".to_string(); for test in a { - hexadecimal.push_str(&format!("{:02X?}", test)); + hexadecimal.push_str(&format!("{test:02X?}")); } hexadecimal } @@ -74,7 +74,7 @@ fn get_hexagonal_string_from_bytes(a: Vec) -> String { fn get_hexagonal_string_from_u64(a: Vec) -> String { let mut hexadecimal: String = "".to_string(); for test in a { - hexadecimal.push_str(&format!("{:016X?}", test)); + hexadecimal.push_str(&format!("{test:016X?}")); } hexadecimal } diff --git a/apps/trivium/src/static_deque/static_deque.rs b/apps/trivium/src/static_deque/static_deque.rs index 3e7c42681..78cbe62d2 100644 --- a/apps/trivium/src/static_deque/static_deque.rs +++ b/apps/trivium/src/static_deque/static_deque.rs @@ -55,7 +55,7 @@ impl Index for StaticDeque { /// 0 is youngest fn index(&self, i: usize) -> &T { if i >= N { - panic!("Index {:?} too high for size {:?}", i, N); + panic!("Index {i:?} too high for size {N:?}"); } &self.arr[(N + self.cursor - i - 1) % N] } @@ -66,7 +66,7 @@ impl IndexMut for StaticDeque { /// 0 is youngest fn index_mut(&mut self, i: usize) -> &mut T { if i >= N { - panic!("Index {:?} too high for size {:?}", i, N); + panic!("Index {i:?} too high for size {N:?}"); } &mut self.arr[(N + self.cursor - i - 1) % N] } diff --git a/apps/trivium/src/trivium/test.rs b/apps/trivium/src/trivium/test.rs index 3b5d4897c..8cf8760ba 100644 --- a/apps/trivium/src/trivium/test.rs +++ b/apps/trivium/src/trivium/test.rs @@ -66,7 +66,7 @@ fn get_hexagonal_string_from_bytes(a: Vec) -> String { assert!(a.len() % 8 == 0); let mut hexadecimal: String = "".to_string(); for test in a { - hexadecimal.push_str(&format!("{:02X?}", test)); + hexadecimal.push_str(&format!("{test:02X?}")); } hexadecimal } @@ -74,7 +74,7 @@ fn get_hexagonal_string_from_bytes(a: Vec) -> String { fn get_hexagonal_string_from_u64(a: Vec) -> String { let mut hexadecimal: String = "".to_string(); for test in a { - hexadecimal.push_str(&format!("{:016X?}", test)); + hexadecimal.push_str(&format!("{test:016X?}")); } hexadecimal } diff --git a/backends/tfhe-cuda-backend/build.rs b/backends/tfhe-cuda-backend/build.rs index 0334701d4..1f8673fd8 100644 --- a/backends/tfhe-cuda-backend/build.rs +++ b/backends/tfhe-cuda-backend/build.rs @@ -93,7 +93,7 @@ fn main() { }; let mut headers_modified = bindings_modified; for header in headers { - println!("cargo:rerun-if-changed={}", header); + println!("cargo:rerun-if-changed={header}"); // Check modification times let header_modified = std::fs::metadata(header).unwrap().modified().unwrap(); if header_modified > headers_modified { diff --git a/tests/backward_compatibility/high_level_api.rs b/tests/backward_compatibility/high_level_api.rs index f8ad1593f..45c0d79ba 100644 --- a/tests/backward_compatibility/high_level_api.rs +++ b/tests/backward_compatibility/high_level_api.rs @@ -277,8 +277,7 @@ pub fn test_hl_clientkey( if test_params != key_params { Err(test.failure( format!( - "Invalid {} parameters:\n Expected :\n{:?}\nGot:\n{:?}", - format, test_params, key_params + "Invalid {format} parameters:\n Expected :\n{test_params:?}\nGot:\n{key_params:?}", ), format, )) @@ -327,8 +326,7 @@ pub fn test_hl_pubkey( if decrypted != value { Err(test.failure( format!( - "Failed to decrypt value encrypted with public key, got {} expected {}", - decrypted, value + "Failed to decrypt value encrypted with public key, got {decrypted} expected {value}", ), format, )) diff --git a/tests/backward_compatibility_tests.rs b/tests/backward_compatibility_tests.rs index df479b76b..e5b1e445f 100644 --- a/tests/backward_compatibility_tests.rs +++ b/tests/backward_compatibility_tests.rs @@ -74,9 +74,9 @@ fn run_test( let test_result = M::run_test(test_dir, testcase, format); match &test_result { - TestResult::Success(r) => println!("{}", r), - TestResult::Failure(r) => println!("{}", r), - TestResult::Skipped(r) => println!("{}", r), + TestResult::Success(r) => println!("{r}"), + TestResult::Failure(r) => println!("{r}"), + TestResult::Skipped(r) => println!("{r}"), } test_result diff --git a/tfhe-csprng/src/generators/implem/aesni/block_cipher.rs b/tfhe-csprng/src/generators/implem/aesni/block_cipher.rs index f5bf56eed..b08c2b6c4 100644 --- a/tfhe-csprng/src/generators/implem/aesni/block_cipher.rs +++ b/tfhe-csprng/src/generators/implem/aesni/block_cipher.rs @@ -20,9 +20,8 @@ impl AesBlockCipher for AesniBlockCipher { if !(aes_detected && sse2_detected) { panic!( "The AesniBlockCipher requires both aes and sse2 x86 CPU features.\n\ - aes feature available: {}\nsse2 feature available: {}\n\ + aes feature available: {aes_detected}\nsse2 feature available: {sse2_detected}\n\ Please consider enabling the SoftwareRandomGenerator with the `software-prng` feature", - aes_detected, sse2_detected ) } diff --git a/tfhe-zk-pok/src/proofs/mod.rs b/tfhe-zk-pok/src/proofs/mod.rs index fceb97ca2..7ea43e06c 100644 --- a/tfhe-zk-pok/src/proofs/mod.rs +++ b/tfhe-zk-pok/src/proofs/mod.rs @@ -331,7 +331,7 @@ mod test { Compress::Yes => Params::uncompress(bincode::deserialize(&bincode::serialize( &public_params.compress(), )?)?) - .map_err(|e| Box::new(ErrorKind::Custom(format!("Failed to uncompress: {}", e)))), + .map_err(|e| Box::new(ErrorKind::Custom(format!("Failed to uncompress: {e}")))), Compress::No => bincode::deserialize(&bincode::serialize(&public_params)?), } } diff --git a/tfhe-zk-pok/src/serialization.rs b/tfhe-zk-pok/src/serialization.rs index bda1a09f5..eb09ea1f1 100644 --- a/tfhe-zk-pok/src/serialization.rs +++ b/tfhe-zk-pok/src/serialization.rs @@ -87,7 +87,7 @@ impl Display for InvalidSerializedAffineError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { InvalidSerializedAffineError::InvalidFp(fp_error) => { - write!(f, "Invalid fp element in affine: {}", fp_error) + write!(f, "Invalid fp element in affine: {fp_error}") } InvalidSerializedAffineError::InvalidCompressedXCoordinate => { write!( @@ -262,10 +262,10 @@ impl Display for InvalidSerializedGroupElementsError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { InvalidSerializedGroupElementsError::InvalidAffine(affine_error) => { - write!(f, "Invalid Affine in GroupElement: {}", affine_error) + write!(f, "Invalid Affine in GroupElement: {affine_error}") } InvalidSerializedGroupElementsError::InvalidGlistDimension(arr_error) => { - write!(f, "invalid number of elements in g_list: {}", arr_error) + write!(f, "invalid number of elements in g_list: {arr_error}") } } } @@ -357,10 +357,10 @@ impl Display for InvalidSerializedPublicParamsError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { InvalidSerializedPublicParamsError::InvalidGroupElements(group_error) => { - write!(f, "Invalid PublicParams: {}", group_error) + write!(f, "Invalid PublicParams: {group_error}") } InvalidSerializedPublicParamsError::InvalidHashDimension(arr_error) => { - write!(f, "invalid size of hash: {}", arr_error) + write!(f, "invalid size of hash: {arr_error}") } } } diff --git a/tfhe/benches/integer/signed_bench.rs b/tfhe/benches/integer/signed_bench.rs index 12de49922..28e419bdc 100644 --- a/tfhe/benches/integer/signed_bench.rs +++ b/tfhe/benches/integer/signed_bench.rs @@ -875,9 +875,7 @@ fn bench_server_key_binary_scalar_function_clean_inputs( let clear_1 = rng_func(&mut rng, bit_size); assert!( range.contains(&clear_1), - "{:?} is not within the range {:?}", - clear_1, - range + "{clear_1:?} is not within the range {range:?}", ); (ct_0, clear_1) @@ -916,9 +914,7 @@ fn bench_server_key_binary_scalar_function_clean_inputs( let clear_1 = rng_func(&mut rng, bit_size); assert!( range.contains(&clear_1), - "{:?} is not within the range {:?}", - clear_1, - range + "{clear_1:?} is not within the range {range:?}", ); clear_1 }) diff --git a/tfhe/docs/references/fine-grained-apis/shortint/operations.md b/tfhe/docs/references/fine-grained-apis/shortint/operations.md index 6c8418c2f..8514be6d4 100644 --- a/tfhe/docs/references/fine-grained-apis/shortint/operations.md +++ b/tfhe/docs/references/fine-grained-apis/shortint/operations.md @@ -107,7 +107,7 @@ fn main() { match ops() { Ok(_) => (), Err(e) => { - println!("correctness of operations is not guaranteed due to error: {}", e); + println!("correctness of operations is not guaranteed due to error: {e}"); return; }, } diff --git a/tfhe/docs/tutorials/parity_bit.md b/tfhe/docs/tutorials/parity_bit.md index 07e0e0806..f8b19bea3 100644 --- a/tfhe/docs/tutorials/parity_bit.md +++ b/tfhe/docs/tutorials/parity_bit.md @@ -135,14 +135,14 @@ fn main() { let fhe_parity_bit = compute_parity_bit(&fhe_bits, mode); let decrypted_parity_bit = fhe_parity_bit.decrypt(&client_key); let is_parity_bit_valid = check_parity_bit_validity(&clear_bits, mode, decrypted_parity_bit); - println!("Parity bit is set: {} for mode: {:?}", decrypted_parity_bit, mode); + println!("Parity bit is set: {decrypted_parity_bit} for mode: {mode:?}"); assert!(is_parity_bit_valid); let mode = ParityMode::Even; let fhe_parity_bit = compute_parity_bit(&fhe_bits, mode); let decrypted_parity_bit = fhe_parity_bit.decrypt(&client_key); let is_parity_bit_valid = check_parity_bit_validity(&clear_bits, mode, decrypted_parity_bit); - println!("Parity bit is set: {} for mode: {:?}", decrypted_parity_bit, mode); + println!("Parity bit is set: {decrypted_parity_bit} for mode: {mode:?}"); assert!(is_parity_bit_valid); } ``` @@ -348,7 +348,7 @@ fn main() { let fhe_parity_bit = compute_parity_bit(&fhe_bits, mode); let decrypted_parity_bit = fhe_parity_bit.decrypt(&client_key); let is_parity_bit_valid = check_parity_bit_validity(&clear_bits, mode, decrypted_parity_bit); - println!("Parity bit is set: {} for mode: {:?}", decrypted_parity_bit, mode); + println!("Parity bit is set: {decrypted_parity_bit} for mode: {mode:?}"); assert!(is_parity_bit_valid); assert_eq!(decrypted_parity_bit, clear_parity_bit); @@ -357,7 +357,7 @@ fn main() { let fhe_parity_bit = compute_parity_bit(&fhe_bits, mode); let decrypted_parity_bit = fhe_parity_bit.decrypt(&client_key); let is_parity_bit_valid = check_parity_bit_validity(&clear_bits, mode, decrypted_parity_bit); - println!("Parity bit is set: {} for mode: {:?}", decrypted_parity_bit, mode); + println!("Parity bit is set: {decrypted_parity_bit} for mode: {mode:?}"); assert!(is_parity_bit_valid); assert_eq!(decrypted_parity_bit, clear_parity_bit); } diff --git a/tfhe/examples/regex_engine/engine.rs b/tfhe/examples/regex_engine/engine.rs index d07a352ce..c440ac9fa 100644 --- a/tfhe/examples/regex_engine/engine.rs +++ b/tfhe/examples/regex_engine/engine.rs @@ -45,7 +45,7 @@ fn build_branches( re: &RegExpr, c_pos: usize, ) -> Vec<(LazyExecution, usize)> { - trace!("program pointer: regex={:?}, content pos={}", re, c_pos); + trace!("program pointer: regex={re:?}, content pos={c_pos}"); match re { RegExpr::Sof => { if c_pos == 0 { diff --git a/tfhe/examples/regex_engine/execution.rs b/tfhe/examples/regex_engine/execution.rs index e17e2e6c6..bfeca9a0c 100644 --- a/tfhe/examples/regex_engine/execution.rs +++ b/tfhe/examples/regex_engine/execution.rs @@ -241,7 +241,7 @@ impl std::fmt::Debug for Executed { 1 => write!(f, "t"), _ => write!(f, "{}", u8_to_char(*c)), }, - Self::CtPos { at } => write!(f, "ct_{}", at), + Self::CtPos { at } => write!(f, "ct_{at}"), Self::And { a, b } => { write!(f, "(")?; a.fmt(f)?; diff --git a/tfhe/examples/regex_engine/parser.rs b/tfhe/examples/regex_engine/parser.rs index 8ae80298d..fc6a2f1c5 100644 --- a/tfhe/examples/regex_engine/parser.rs +++ b/tfhe/examples/regex_engine/parser.rs @@ -119,7 +119,7 @@ impl fmt::Debug for RegExpr { at_most, } => { let stringify_opt_n = |opt_n: &Option| -> String { - opt_n.map_or("*".to_string(), |n| format!("{:?}", n)) + opt_n.map_or("*".to_string(), |n| format!("{n:?}")) }; repeat_re.fmt(f)?; write!( diff --git a/tfhe/examples/sha256_bool/main.rs b/tfhe/examples/sha256_bool/main.rs index 2d8fc3a7c..02d3905c1 100644 --- a/tfhe/examples/sha256_bool/main.rs +++ b/tfhe/examples/sha256_bool/main.rs @@ -33,7 +33,7 @@ fn main() { input = input.trim_end_matches('\n').to_string(); - println!("You entered: \"{}\"", input); + println!("You entered: \"{input}\""); // CLIENT PADS DATA AND ENCRYPTS IT @@ -52,7 +52,7 @@ fn main() { let output = decrypt_bools(&encrypted_output, &ck); let outhex = bools_to_hex(output); - println!("{}", outhex); + println!("{outhex}"); } fn encrypt_bools(bools: &Vec, ck: &ClientKey) -> Vec { diff --git a/tfhe/examples/sha256_bool/padding.rs b/tfhe/examples/sha256_bool/padding.rs index 26396348d..4b5c1f1b5 100644 --- a/tfhe/examples/sha256_bool/padding.rs +++ b/tfhe/examples/sha256_bool/padding.rs @@ -12,7 +12,7 @@ pub fn pad_sha256_input(input: &str) -> Vec { // hex value can be converted to bytes no_prefix.to_string() } else { - format!("0{}", no_prefix) // pad hex value to ensure a correct conversion to bytes + format!("0{no_prefix}") // pad hex value to ensure a correct conversion to bytes }; hex_input .as_bytes() diff --git a/tfhe/examples/sha256_bool/sha256_function.rs b/tfhe/examples/sha256_bool/sha256_function.rs index 8c104fdb9..7960f88a2 100644 --- a/tfhe/examples/sha256_bool/sha256_function.rs +++ b/tfhe/examples/sha256_bool/sha256_function.rs @@ -158,7 +158,7 @@ pub fn bools_to_hex(bools: Vec) -> String { counter += 1; if counter == 8 { - hex_string.push_str(&format!("{:02x}", byte)); + hex_string.push_str(&format!("{byte:02x}")); byte = 0; counter = 0; } @@ -167,7 +167,7 @@ pub fn bools_to_hex(bools: Vec) -> String { // Handle any remaining bits in case the bools vector length is not a multiple of 8 if counter > 0 { byte <<= 8 - counter; - hex_string.push_str(&format!("{:02x}", byte)); + hex_string.push_str(&format!("{byte:02x}")); } hex_string diff --git a/tfhe/examples/utilities/hlapi_compact_pk_ct_sizes.rs b/tfhe/examples/utilities/hlapi_compact_pk_ct_sizes.rs index f0b1da5dc..8c6425404 100644 --- a/tfhe/examples/utilities/hlapi_compact_pk_ct_sizes.rs +++ b/tfhe/examples/utilities/hlapi_compact_pk_ct_sizes.rs @@ -78,7 +78,7 @@ pub fn cpk_and_cctl_sizes(results_file: &Path) { .build(); let cctl_size = bincode::serialize(&encrypted_inputs).unwrap().len(); - println!("Compact CT list for {NB_CTXT} CTs: {} bytes", cctl_size); + println!("Compact CT list for {NB_CTXT} CTs: {cctl_size} bytes"); write_result(&mut file, &test_name, cctl_size); write_to_json::( @@ -124,7 +124,7 @@ pub fn cpk_and_cctl_sizes(results_file: &Path) { .build(); let cctl_size = bincode::serialize(&encrypted_inputs).unwrap().len(); - println!("Compact CT list for {NB_CTXT} CTs: {} bytes", cctl_size); + println!("Compact CT list for {NB_CTXT} CTs: {cctl_size} bytes"); write_result(&mut file, &test_name, cctl_size); write_to_json::( diff --git a/tfhe/examples/utilities/params_to_file.rs b/tfhe/examples/utilities/params_to_file.rs index 2c62c1a70..640992a8e 100644 --- a/tfhe/examples/utilities/params_to_file.rs +++ b/tfhe/examples/utilities/params_to_file.rs @@ -351,14 +351,14 @@ fn write_all_params_in_file + Copy + Name let (ref_param, ref_param_name) = &group[0]; let formatted_param = match key.parameters_format { ParametersFormat::Lwe => { - param_names_augmented.push(format!("{}_LWE", ref_param_name)); + param_names_augmented.push(format!("{ref_param_name}_LWE")); format_lwe_parameters_to_lattice_estimator( (ref_param, ref_param_name.as_str()), &similar_params, ) } ParametersFormat::Glwe => { - param_names_augmented.push(format!("{}_GLWE", ref_param_name)); + param_names_augmented.push(format!("{ref_param_name}_GLWE")); format_glwe_parameters_to_lattice_estimator( (ref_param, ref_param_name.as_str()), &similar_params, diff --git a/tfhe/examples/utilities/shortint_key_sizes.rs b/tfhe/examples/utilities/shortint_key_sizes.rs index 3eec01225..3dcca551c 100644 --- a/tfhe/examples/utilities/shortint_key_sizes.rs +++ b/tfhe/examples/utilities/shortint_key_sizes.rs @@ -139,7 +139,7 @@ fn measure_serialized_size( &test_name, @@ -151,10 +151,7 @@ fn measure_serialized_size size: {} bytes", - test_name_suffix, param_name, size, - ); + println!("{test_name_suffix} {param_name} -> size: {size} bytes",); } fn tuniform_key_set_sizes(results_file: &Path) { diff --git a/tfhe/examples/utilities/wasm_benchmarks_parser.rs b/tfhe/examples/utilities/wasm_benchmarks_parser.rs index ef8e0833d..687c1c095 100644 --- a/tfhe/examples/utilities/wasm_benchmarks_parser.rs +++ b/tfhe/examples/utilities/wasm_benchmarks_parser.rs @@ -55,7 +55,7 @@ pub fn parse_wasm_benchmarks(results_file: &Path, raw_results_file: &Path) { let name_parts = full_name.split("_mean_").collect::>(); let bench_name = name_parts[0]; let params: PBSParameters = params_from_name(name_parts[1]).into(); - println!("{:?}", name_parts); + println!("{name_parts:?}"); if bench_name.contains("_size") { write_result(&mut file, &prefixed_full_name, *val as usize); } else { diff --git a/tfhe/src/core_crypto/gpu/mod.rs b/tfhe/src/core_crypto/gpu/mod.rs index 200fb20b8..cab0b3004 100644 --- a/tfhe/src/core_crypto/gpu/mod.rs +++ b/tfhe/src/core_crypto/gpu/mod.rs @@ -157,7 +157,7 @@ pub unsafe fn programmable_bootstrap_async( lwe_array_in.as_c_ptr(0), lwe_in_indexes.as_c_ptr(0), bootstrapping_key.as_c_ptr(0), - &ms_noise_reduction_key_ffi, + &raw const ms_noise_reduction_key_ffi, ms_noise_reduction_ptr, pbs_buffer, lwe_dimension.0 as u32, @@ -226,7 +226,7 @@ pub unsafe fn programmable_bootstrap_128_async( test_vector.as_c_ptr(0), lwe_array_in.as_c_ptr(0), bootstrapping_key.as_c_ptr(0), - &ms_noise_reduction_key_ffi, + &raw const ms_noise_reduction_key_ffi, ms_noise_reduction_ptr, pbs_buffer, lwe_dimension.0 as u32, @@ -616,9 +616,9 @@ pub unsafe fn add_lwe_ciphertext_vector_async( cuda_add_lwe_ciphertext_vector_64( streams.ptr[0], streams.gpu_indexes[0].get(), - &mut lwe_array_out_data, - &lwe_array_in_1_data, - &lwe_array_in_2_data, + &raw mut lwe_array_out_data, + &raw const lwe_array_in_1_data, + &raw const lwe_array_in_2_data, ); } @@ -658,9 +658,9 @@ pub unsafe fn add_lwe_ciphertext_vector_assign_async( cuda_add_lwe_ciphertext_vector_64( streams.ptr[0], streams.gpu_indexes[0].get(), - &mut lwe_array_out_data, - &lwe_array_out_data, - &lwe_array_in_data, + &raw mut lwe_array_out_data, + &raw const lwe_array_out_data, + &raw const lwe_array_in_data, ); } diff --git a/tfhe/src/integer/gpu/ciphertext/mod.rs b/tfhe/src/integer/gpu/ciphertext/mod.rs index 610686244..97c478d68 100644 --- a/tfhe/src/integer/gpu/ciphertext/mod.rs +++ b/tfhe/src/integer/gpu/ciphertext/mod.rs @@ -616,7 +616,7 @@ pub unsafe fn expand_async( bootstrapping_key.ptr.as_ptr(), computing_ks_key.ptr.as_ptr(), casting_key.ptr.as_ptr(), - &ms_noise_reduction_key_ffi, + &raw const ms_noise_reduction_key_ffi, ); cleanup_expand_without_verification_64( streams.ptr.as_ptr(), diff --git a/tfhe/src/integer/gpu/mod.rs b/tfhe/src/integer/gpu/mod.rs index 27de61715..652d390e3 100644 --- a/tfhe/src/integer/gpu/mod.rs +++ b/tfhe/src/integer/gpu/mod.rs @@ -275,7 +275,7 @@ pub unsafe fn scalar_addition_integer_radix_assign_async( streams.ptr.as_ptr(), streams.gpu_indexes_ptr(), streams.len() as u32, - &mut cuda_ffi_lwe_array, + &raw mut cuda_ffi_lwe_array, scalar_input.as_c_ptr(0), h_scalar_input.as_ptr().cast::(), num_scalars, @@ -374,13 +374,13 @@ pub unsafe fn unchecked_scalar_mul_integer_radix_kb_async(), has_at_least_one_set.as_ptr().cast::(), mem_ptr, bootstrapping_key.ptr.as_ptr(), keyswitch_key.ptr.as_ptr(), - &ms_noise_reduction_key_ffi, + &raw const ms_noise_reduction_key_ffi, polynomial_size.0 as u32, message_modulus.0 as u32, num_scalars, @@ -631,9 +631,9 @@ pub unsafe fn unchecked_add_integer_radix_assign_async( cuda_add_lwe_ciphertext_vector_64( streams.ptr[0], streams.gpu_indexes[0].get(), - &mut cuda_ffi_radix_lwe_left, - &cuda_ffi_radix_lwe_left, - &cuda_ffi_radix_lwe_right, + &raw mut cuda_ffi_radix_lwe_left, + &raw const cuda_ffi_radix_lwe_left, + &raw const cuda_ffi_radix_lwe_right, ); update_noise_degree(radix_lwe_left, &cuda_ffi_radix_lwe_left); } @@ -767,14 +767,14 @@ pub unsafe fn unchecked_mul_integer_radix_kb_assign_async(), min(clear_blocks.len() as u32, num_blocks), mem_ptr, bootstrapping_key.ptr.as_ptr(), keyswitch_key.ptr.as_ptr(), - &ms_noise_reduction_key_ffi, + &raw const ms_noise_reduction_key_ffi, ); cleanup_cuda_integer_bitop( streams.ptr.as_ptr(), @@ -1208,13 +1208,13 @@ pub unsafe fn unchecked_comparison_integer_radix_kb_async(), mem_ptr, bootstrapping_key.ptr.as_ptr(), keyswitch_key.ptr.as_ptr(), - &ms_noise_reduction_key_ffi, + &raw const ms_noise_reduction_key_ffi, num_scalar_blocks, ); @@ -1474,10 +1474,10 @@ pub unsafe fn full_propagate_assign_async( streams.ptr.as_ptr(), streams.gpu_indexes_ptr(), streams.len() as u32, - &mut cuda_ffi_radix_lwe_input, + &raw mut cuda_ffi_radix_lwe_input, mem_ptr, keyswitch_key.ptr.as_ptr(), - &ms_noise_reduction_key_ffi, + &raw const ms_noise_reduction_key_ffi, bootstrapping_key.ptr.as_ptr(), num_blocks, ); @@ -1614,13 +1614,13 @@ pub(crate) unsafe fn propagate_single_carry_assign_async( streams.ptr.as_ptr(), streams.gpu_indexes_ptr(), streams.len() as u32, - &mut cuda_ffi_output, - &cuda_ffi_input, + &raw mut cuda_ffi_output, + &raw const cuda_ffi_input, mem_ptr, keyswitch_key.ptr.as_ptr(), - &ms_noise_reduction_key_ffi, + &raw const ms_noise_reduction_key_ffi, bootstrapping_key.ptr.as_ptr(), ); cleanup_cuda_apply_univariate_lut_kb_64( @@ -3446,11 +3446,11 @@ pub unsafe fn apply_many_univariate_lut_kb_async streams.ptr.as_ptr(), streams.gpu_indexes_ptr(), streams.len() as u32, - &mut cuda_ffi_output, - &cuda_ffi_input, + &raw mut cuda_ffi_output, + &raw const cuda_ffi_input, mem_ptr, keyswitch_key.ptr.as_ptr(), - &ms_noise_reduction_key_ffi, + &raw const ms_noise_reduction_key_ffi, bootstrapping_key.ptr.as_ptr(), num_many_lut, lut_stride, @@ -3582,12 +3582,12 @@ pub unsafe fn apply_bivariate_lut_kb_async( streams.ptr.as_ptr(), streams.gpu_indexes_ptr(), streams.len() as u32, - &mut cuda_ffi_output, - &cuda_ffi_input_1, - &cuda_ffi_input_2, + &raw mut cuda_ffi_output, + &raw const cuda_ffi_input_1, + &raw const cuda_ffi_input_2, mem_ptr, keyswitch_key.ptr.as_ptr(), - &ms_noise_reduction_key_ffi, + &raw const ms_noise_reduction_key_ffi, bootstrapping_key.ptr.as_ptr(), num_blocks, shift, @@ -3744,15 +3744,15 @@ pub unsafe fn unchecked_div_rem_integer_radix_kb_assign_async>() .as_ptr(), streams.len() as u32, - &mut cuda_ffi_radix_lwe_output, + &raw mut cuda_ffi_radix_lwe_output, ); update_noise_degree(radix_lwe_output, &cuda_ffi_radix_lwe_output); } @@ -4085,14 +4085,14 @@ pub(crate) unsafe fn unchecked_unsigned_overflowing_sub_integer_radix_kb_assign_ streams.ptr.as_ptr(), streams.gpu_indexes_ptr(), streams.len() as u32, - &mut cuda_ffi_radix_lwe_left, - &cuda_ffi_radix_lwe_right, - &mut cuda_ffi_carry_out, - &cuda_ffi_carry_in, + &raw mut cuda_ffi_radix_lwe_left, + &raw const cuda_ffi_radix_lwe_right, + &raw mut cuda_ffi_carry_out, + &raw const cuda_ffi_carry_in, mem_ptr, bootstrapping_key.ptr.as_ptr(), keyswitch_key.ptr.as_ptr(), - &ms_noise_reduction_key_ffi, + &raw const ms_noise_reduction_key_ffi, compute_overflow as u32, uses_input_borrow, ); @@ -4187,12 +4187,12 @@ pub unsafe fn unchecked_signed_abs_radix_kb_assign_async panic!("{:?}", x), + /// Err(x) => panic!("{x:?}"), /// Ok(y) => { /// let clear: u64 = cks.decrypt(&y); /// assert_eq!(msg1 + msg2, clear); diff --git a/tfhe/src/integer/server_key/radix/bitwise_op.rs b/tfhe/src/integer/server_key/radix/bitwise_op.rs index 3e982a5a4..422efeb8b 100644 --- a/tfhe/src/integer/server_key/radix/bitwise_op.rs +++ b/tfhe/src/integer/server_key/radix/bitwise_op.rs @@ -120,7 +120,7 @@ impl ServerKey { /// let ct_res = sks.checked_bitand(&ct1, &ct2); /// /// match ct_res { - /// Err(x) => panic!("{:?}", x), + /// Err(x) => panic!("{x:?}"), /// Ok(y) => { /// let clear: u64 = cks.decrypt(&y); /// assert_eq!(msg1 & msg2, clear); @@ -306,7 +306,7 @@ impl ServerKey { /// let ct_res = sks.checked_bitor(&ct1, &ct2); /// /// match ct_res { - /// Err(x) => panic!("{:?}", x), + /// Err(x) => panic!("{x:?}"), /// Ok(y) => { /// let clear: u64 = cks.decrypt(&y); /// assert_eq!(msg1 | msg2, clear); @@ -495,7 +495,7 @@ impl ServerKey { /// let ct_res = sks.checked_bitxor(&ct1, &ct2); /// /// match ct_res { - /// Err(x) => panic!("{:?}", x), + /// Err(x) => panic!("{x:?}"), /// Ok(y) => { /// let clear: u64 = cks.decrypt(&y); /// assert_eq!(msg1 ^ msg2, clear); diff --git a/tfhe/src/integer/server_key/radix/neg.rs b/tfhe/src/integer/server_key/radix/neg.rs index d5ff88af8..a60ffdb08 100644 --- a/tfhe/src/integer/server_key/radix/neg.rs +++ b/tfhe/src/integer/server_key/radix/neg.rs @@ -191,7 +191,7 @@ impl ServerKey { /// let ct_res = sks.checked_neg(&ctxt); /// /// match ct_res { - /// Err(x) => panic!("{:?}", x), + /// Err(x) => panic!("{x:?}"), /// Ok(y) => { /// let clear: u64 = cks.decrypt(&y); /// assert_eq!(255, clear); diff --git a/tfhe/src/integer/server_key/radix/scalar_mul.rs b/tfhe/src/integer/server_key/radix/scalar_mul.rs index 954249e12..ad25810ba 100644 --- a/tfhe/src/integer/server_key/radix/scalar_mul.rs +++ b/tfhe/src/integer/server_key/radix/scalar_mul.rs @@ -178,7 +178,7 @@ impl ServerKey { /// let ct_res = sks.checked_small_scalar_mul(&ct, scalar); /// /// match ct_res { - /// Err(x) => panic!("{:?}", x), + /// Err(x) => panic!("{x:?}"), /// Ok(y) => { /// let clear: u64 = cks.decrypt(&y); /// assert_eq!(msg * scalar, clear); diff --git a/tfhe/src/integer/server_key/radix/sub.rs b/tfhe/src/integer/server_key/radix/sub.rs index 2327e7e71..007531a74 100644 --- a/tfhe/src/integer/server_key/radix/sub.rs +++ b/tfhe/src/integer/server_key/radix/sub.rs @@ -175,7 +175,7 @@ impl ServerKey { /// let ct_res = sks.checked_sub(&ctxt_1, &ctxt_2); /// /// match ct_res { - /// Err(x) => panic!("{:?}", x), + /// Err(x) => panic!("{x:?}"), /// Ok(y) => { /// let clear: u64 = cks.decrypt(&y); /// assert_eq!(0, clear); diff --git a/toolchain.txt b/toolchain.txt index 45d701093..ccc1030cc 100644 --- a/toolchain.txt +++ b/toolchain.txt @@ -1 +1 @@ -nightly-2025-04-16 +nightly-2025-04-28 diff --git a/utils/tfhe-versionable-derive/src/dispatch_type.rs b/utils/tfhe-versionable-derive/src/dispatch_type.rs index c47572afb..5116b8b0e 100644 --- a/utils/tfhe-versionable-derive/src/dispatch_type.rs +++ b/utils/tfhe-versionable-derive/src/dispatch_type.rs @@ -62,8 +62,7 @@ impl AssociatedType for DispatchType { return Err(syn::Error::new( lt.lifetime.span(), format!( - "Lifetime name {} conflicts with the one used by macro `Version`", - LIFETIME_NAME + "Lifetime name {LIFETIME_NAME} conflicts with the one used by macro `Version`" ), )); } diff --git a/utils/tfhe-versionable-derive/src/version_type.rs b/utils/tfhe-versionable-derive/src/version_type.rs index 42104a082..e15373707 100644 --- a/utils/tfhe-versionable-derive/src/version_type.rs +++ b/utils/tfhe-versionable-derive/src/version_type.rs @@ -59,8 +59,7 @@ impl AssociatedType for VersionType { return Err(syn::Error::new( lt.lifetime.span(), format!( - "Lifetime name {} conflicts with the one used by macro `Version`", - LIFETIME_NAME + "Lifetime name {LIFETIME_NAME} conflicts with the one used by macro `Version`", ), )); } diff --git a/utils/tfhe-versionable-derive/src/versionize_impl.rs b/utils/tfhe-versionable-derive/src/versionize_impl.rs index 043d413aa..6d6731911 100644 --- a/utils/tfhe-versionable-derive/src/versionize_impl.rs +++ b/utils/tfhe-versionable-derive/src/versionize_impl.rs @@ -210,7 +210,7 @@ impl VersionizeImplementor { add_trait_where_clause( &mut generics, [&parse_quote!(#dispatch_enum_path #dispatch_ty_generics)], - &[format!("{}", DISPATCH_TRAIT_NAME,)], + &[format!("{DISPATCH_TRAIT_NAME}")], )?; } Self::Convert(convert_attr) => { @@ -220,7 +220,7 @@ impl VersionizeImplementor { [&parse_quote!(#convert_type_path)], &[ VERSIONIZE_OWNED_TRAIT_NAME, - &format!("{}", FROM_TRAIT_NAME), + &format!("{FROM_TRAIT_NAME}"), ], )?; } @@ -252,7 +252,7 @@ impl VersionizeImplementor { let mut generics = input_generics.clone(); let convert_type_path = &convert_attr.conversion_target; let into_trait = match convert_attr.conversion_type { - ConversionType::Direct => format!("{}", INTO_TRAIT_NAME), + ConversionType::Direct => format!("{INTO_TRAIT_NAME}"), ConversionType::Try => { // Doing a TryFrom requires that the error // impl Error + Send + Sync + 'static @@ -268,7 +268,7 @@ impl VersionizeImplementor { &[STATIC_LIFETIME_NAME], )?; - format!("{}", TRY_INTO_TRAIT_NAME) + format!("{TRY_INTO_TRAIT_NAME}") } }; add_trait_where_clause( @@ -276,7 +276,7 @@ impl VersionizeImplementor { [&parse_quote!(#convert_type_path)], &[ UNVERSIONIZE_TRAIT_NAME, - &format!("{}", FROM_TRAIT_NAME), + &format!("{FROM_TRAIT_NAME}"), &into_trait, ], )?;