You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bump the crate from Rust edition 2021 to edition 2024 and adopt relative modern idioms. Edition 2024 stabilized in Rust 1.85 (Feb 2025); the repo toolchain is 1.94+, so it builds locally and on CI.
pub use re-exports of private modules (error::ReadingError, grid_search::…): at most unreachable_pub warnings; cargo fix --edition handles.
cfg(coverage) / cfg(tarpaulin): not referenced in source → the new unexpected_cfgs lint won't fire from our code.
MSRV: no rust-version declared today → edition 2024 implies MSRV ≥ 1.85. Impact is on downstream consumers of the published crate (fine for 0.x).
Plan (sub-issues below)
Sub-issue
Scope
A. Edition flip
cargo fix --edition --allow-dirty --allow-staged --all-features; set edition = "2024" in Cargo.toml; update AGENTS.md ("Rust 2021" → "Rust 2024"), README changelog line, CHANGELOG.md (breaking re: implied MSRV). Inspect the auto-fix diff before flipping the edition flag.
B. #[allow] → #[expect]
Migrate ~10 lint-suppression sites to #[expect(...)]: crate-root #![allow(...)] in lib.rs; #![allow(non_snake_case)] in cholesky.rs/svd.rs/lu.rs/auc.rs/mahalanobis.rs; #[allow(dead_code)] in distance/cosine.rs + lu.rs; #![allow(clippy::ptr_arg, clippy::needless_range_loop)] in cluster/mod.rs + cluster_helpers.rs; #![allow(clippy::wrong_self_convention)] in linalg/traits/mod.rs. Verify each lint actually fires — #[expect] errors if a suppression goes stale; keep #[allow] wherever the lint currently doesn't fire.
C. Declare MSRV
Add rust-version = "1.85" to Cargo.toml. Honest about the downstream breaking implication of edition 2024.
D. unsafe cleanup
Tracked by #368 (linked as a sub-issue below, not duplicated). Replace the 4 unsafe { } blocks in src/linalg/basic/matrix.rs with safe split_at_mut. Ships as its own PR.
I'm submitting a
Summary
Bump the crate from Rust edition 2021 to edition 2024 and adopt relative modern idioms. Edition 2024 stabilized in Rust 1.85 (Feb 2025); the repo toolchain is 1.94+, so it builds locally and on CI.
Pre-migration audit (already performed, read-only)
The two edition-2024 hazards that usually bite hardest do not apply here:
-> impl Traitreturns (zero RPIT) → no return-position-impl-trait lifetime over-capture regression.dyn Traitalready carry explicit+ 'alifetimes (e.g.Box<dyn ArrayView1<T> + 'a>) → no dyn-elision surprise.Other hazards are clean or trivial:
unsafe: only 4unsafe { }blocks insrc/linalg/basic/matrix.rs(raw-pointeriterator_mut, already tracked by tech-debt: replace unsafe raw-pointer iterator_mut in DenseMatrix (basic/matrix.rs) with safe split_at_mut approach #368). Nounsafe fn/unsafe impl, sounsafe_op_in_unsafe_fn(default-warn in 2024) doesn't fire. No#[no_mangle]/#[export_name]/#[link_section](no unsafe-attr migration).pub usere-exports of private modules (error::ReadingError,grid_search::…): at mostunreachable_pubwarnings;cargo fix --editionhandles.cfg(coverage)/cfg(tarpaulin): not referenced in source → the newunexpected_cfgslint won't fire from our code.rust-versiondeclared today → edition 2024 implies MSRV ≥ 1.85. Impact is on downstream consumers of the published crate (fine for 0.x).Plan (sub-issues below)
cargo fix --edition --allow-dirty --allow-staged --all-features; setedition = "2024"inCargo.toml; update AGENTS.md ("Rust 2021" → "Rust 2024"), README changelog line,CHANGELOG.md(breaking re: implied MSRV). Inspect the auto-fix diff before flipping the edition flag.#[allow]→#[expect]#[expect(...)]: crate-root#![allow(...)]inlib.rs;#![allow(non_snake_case)]incholesky.rs/svd.rs/lu.rs/auc.rs/mahalanobis.rs;#[allow(dead_code)]indistance/cosine.rs+lu.rs;#![allow(clippy::ptr_arg, clippy::needless_range_loop)]incluster/mod.rs+cluster_helpers.rs;#![allow(clippy::wrong_self_convention)]inlinalg/traits/mod.rs. Verify each lint actually fires —#[expect]errors if a suppression goes stale; keep#[allow]wherever the lint currently doesn't fire.rust-version = "1.85"toCargo.toml. Honest about the downstream breaking implication of edition 2024.unsafecleanupunsafe { }blocks insrc/linalg/basic/matrix.rswith safesplit_at_mut. Ships as its own PR.Execution
edition-2024offdevelopment(orthogonal to theimprove-coverage/ ci(coverage): include doctests + strict --fail-under 44 gate (Stage 0, #399) #400 effort).cargo fmt --all -- --check;cargo clippy --all-features -- -Drust-2018-idioms -Dwarnings;cargo test --all-features.Do you want to work on this issue?
yes — staged PRs target
development.