Skip to content

Commit edb435b

Browse files
committed
chore: update msrv to 1.91.1
1 parent 071e70c commit edb435b

File tree

57 files changed

+164
-133
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+164
-133
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ exclude = [
2424
]
2525

2626
[workspace.package]
27-
rust-version = "1.85"
27+
rust-version = "1.91.1"
2828

2929
[workspace.dependencies]
3030
aligned-vec = { version = "0.6", default-features = false }

Makefile

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -427,21 +427,21 @@ clippy_rustdoc: install_rs_check_toolchain
427427
echo "WARNING: skipped clippy_rustdoc, unsupported OS $(OS)"; \
428428
exit 0; \
429429
fi && \
430-
CARGO_TERM_QUIET=true CLIPPYFLAGS="-D warnings" RUSTDOCFLAGS="--no-run --nocapture --test-builder ./scripts/clippy_driver.sh -Z unstable-options" \
430+
CARGO_TERM_QUIET=true CLIPPYFLAGS="-D warnings" RUSTDOCFLAGS="--no-run --test-builder ./scripts/clippy_driver.sh -Z unstable-options" \
431431
cargo "$(CARGO_RS_CHECK_TOOLCHAIN)" test --doc \
432432
--features=boolean,shortint,integer,zk-pok,pbs-stats,strings,experimental \
433-
-p tfhe
433+
-p tfhe -- --nocapture
434434

435435
.PHONY: clippy_rustdoc_gpu # Run clippy lints on doctests enabling the boolean, shortint, integer and zk-pok
436436
clippy_rustdoc_gpu: install_rs_check_toolchain
437437
if [[ "$(OS)" != "Linux" ]]; then \
438438
echo "WARNING: skipped clippy_rustdoc_gpu, unsupported OS $(OS)"; \
439439
exit 0; \
440440
fi && \
441-
CARGO_TERM_QUIET=true CLIPPYFLAGS="-D warnings" RUSTDOCFLAGS="--no-run --nocapture --test-builder ./scripts/clippy_driver.sh -Z unstable-options" \
441+
CARGO_TERM_QUIET=true CLIPPYFLAGS="-D warnings" RUSTDOCFLAGS="--no-run --test-builder ./scripts/clippy_driver.sh -Z unstable-options" \
442442
cargo "$(CARGO_RS_CHECK_TOOLCHAIN)" test --doc \
443443
--features=boolean,shortint,integer,zk-pok,pbs-stats,strings,experimental,gpu \
444-
-p tfhe
444+
-p tfhe -- --nocapture
445445

446446
.PHONY: clippy_c_api # Run clippy lints enabling the boolean, shortint and the C API
447447
clippy_c_api: install_rs_check_toolchain
@@ -649,11 +649,19 @@ build_web_js_api: install_rs_build_toolchain install_wasm_pack
649649
-- --features=boolean-client-js-wasm-api,shortint-client-js-wasm-api,integer-client-js-wasm-api,zk-pok,extended-types
650650

651651
.PHONY: build_web_js_api_parallel # Build the js API targeting the web browser with parallelism support
652+
# parallel wasm requires specific build options, see https://github.com/rust-lang/rust/pull/147225
652653
build_web_js_api_parallel: install_rs_check_toolchain install_wasm_pack
653654
cd tfhe && \
654655
rustup component add rust-src --toolchain $(RS_CHECK_TOOLCHAIN) && \
655-
RUSTFLAGS="$(WASM_RUSTFLAGS) -C target-feature=+atomics,+bulk-memory" rustup run $(RS_CHECK_TOOLCHAIN) \
656-
wasm-pack build --release --target=web \
656+
RUSTFLAGS="$(WASM_RUSTFLAGS) -C target-feature=+atomics,+bulk-memory \
657+
-Clink-arg=--shared-memory \
658+
-Clink-arg=--max-memory=1073741824 \
659+
-Clink-arg=--import-memory \
660+
-Clink-arg=--export=__wasm_init_tls \
661+
-Clink-arg=--export=__tls_size \
662+
-Clink-arg=--export=__tls_align \
663+
-Clink-arg=--export=__tls_base" \
664+
rustup run $(RS_CHECK_TOOLCHAIN) wasm-pack build --release --target=web \
657665
-- --features=boolean-client-js-wasm-api,shortint-client-js-wasm-api,integer-client-js-wasm-api,parallel-wasm-api,zk-pok,extended-types \
658666
-Z build-std=panic_abort,std && \
659667
find pkg/snippets -type f -iname workerHelpers.js -exec sed -i "s|const pkg = await import('..\/..\/..');|const pkg = await import('..\/..\/..\/tfhe.js');|" {} \;

backends/tfhe-hpu-backend/src/fw/fw_impl/ilp_div.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,7 @@ pub fn iop_div_corev(
659659
}
660660

661661
remain_a = Vec::new();
662+
#[allow(clippy::needless_range_loop)]
662663
for i in 0..block_nb {
663664
remain_tmp_v[0][i] = &remain_tmp_v[0][i] + &remain_tmp_v[1][i];
664665
remain_tmp_v[2][i] = &remain_tmp_v[2][i] + &remain_tmp_v[3][i];

tfhe-fft/src/fft_simd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub const H1Y: f64 = -0.38268343236508984f64;
5454
struct AssertC64Vec<T>(PhantomData<T>);
5555
impl<T> AssertC64Vec<T> {
5656
pub const VALID: () = {
57-
assert!(core::mem::size_of::<T>() % core::mem::size_of::<c64>() == 0);
57+
assert!(core::mem::size_of::<T>().is_multiple_of(core::mem::size_of::<c64>()));
5858
};
5959
}
6060

tfhe-fft/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@
7373
clippy::too_many_arguments,
7474
non_camel_case_types
7575
)]
76-
// Should be removed when we raise MSRV above 1.87
77-
#![allow(clippy::manual_is_multiple_of)]
7876
#![cfg_attr(docsrs, feature(doc_cfg))]
7977
#![warn(rustdoc::broken_intra_doc_links)]
8078

tfhe-ntt/src/prime.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,18 @@ pub const fn is_prime64(n: u64) -> bool {
8383
// hand-unrolled for the compiler to optimize divisions
8484
#[rustfmt::skip]
8585
{
86-
if n % 2 == 0 { return n == 2; }
87-
if n % 3 == 0 { return n == 3; }
88-
if n % 5 == 0 { return n == 5; }
89-
if n % 7 == 0 { return n == 7; }
90-
if n % 11 == 0 { return n == 11; }
91-
if n % 13 == 0 { return n == 13; }
92-
if n % 17 == 0 { return n == 17; }
93-
if n % 19 == 0 { return n == 19; }
94-
if n % 23 == 0 { return n == 23; }
95-
if n % 29 == 0 { return n == 29; }
96-
if n % 31 == 0 { return n == 31; }
97-
if n % 37 == 0 { return n == 37; }
86+
if n.is_multiple_of(2) { return n == 2; }
87+
if n.is_multiple_of(3) { return n == 3; }
88+
if n.is_multiple_of(5) { return n == 5; }
89+
if n.is_multiple_of(7) { return n == 7; }
90+
if n.is_multiple_of(11) { return n == 11; }
91+
if n.is_multiple_of(13) { return n == 13; }
92+
if n.is_multiple_of(17) { return n == 17; }
93+
if n.is_multiple_of(19) { return n == 19; }
94+
if n.is_multiple_of(23) { return n == 23; }
95+
if n.is_multiple_of(29) { return n == 29; }
96+
if n.is_multiple_of(31) { return n == 31; }
97+
if n.is_multiple_of(37) { return n == 37; }
9898
};
9999

100100
// deterministic miller rabin test, works for any n < 2^64
@@ -104,7 +104,7 @@ pub const fn is_prime64(n: u64) -> bool {
104104
let mut s = 0;
105105
let mut d = n - 1;
106106

107-
while d % 2 == 0 {
107+
while d.is_multiple_of(2) {
108108
s += 1;
109109
d /= 2;
110110
}

tfhe-ntt/src/product.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ impl Plan {
156156
factors: impl AsRef<[u64]>,
157157
) -> Option<Self> {
158158
fn try_new_impl(polynomial_size: usize, modulus: u64, primes: &mut [u64]) -> Option<Plan> {
159-
if polynomial_size % 2 != 0 {
159+
if !polynomial_size.is_multiple_of(2) {
160160
return None;
161161
}
162162

tfhe-ntt/src/roots.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub const fn get_q_s64(p: Div64) -> (u64, u64) {
77
let p = p.divisor();
88
let mut q = p - 1;
99
let mut s = 0;
10-
while q % 2 == 0 {
10+
while q.is_multiple_of(2) {
1111
q /= 2;
1212
s += 1;
1313
}

tfhe-zk-pok/src/four_squares.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ pub fn four_squares(v: u128, sanity_check_mode: ProofSanityCheckMode) -> [u64; 4
226226

227227
let mut d = p - 1;
228228
let mut s = 0u32;
229-
while d % 2 == 0 {
229+
while d.is_multiple_of(2) {
230230
d /= 2;
231231
s += 1;
232232
}

tfhe/examples/sha256_bool/padding.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
pub fn pad_sha256_input(input: &str) -> Vec<bool> {
99
let bytes = if input.starts_with("0x") && is_valid_hex(&input[2..]) {
1010
let no_prefix = &input[2..];
11-
let hex_input = if no_prefix.len() % 2 == 0 {
11+
let hex_input = if no_prefix.len().is_multiple_of(2) {
1212
// hex value can be converted to bytes
1313
no_prefix.to_string()
1414
} else {

0 commit comments

Comments
 (0)