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
Adopt the standard‑library assert_matches! / debug_assert_matches! macros in unit and integration tests once they actually reach a stable Rust release.
Background
Issue #324 (MSRV bump to Rust 1.95) listed this task:
Replace manual pattern‑matching assertions in tests with assert_matches!
The stabilization PR (rust‑lang/rust#137487, "Stabilize assert_matches") was tagged milestone 1.95.0, but did not actually ship stable in rustc 1.95.0. The shipped library source for the 1.95.0 toolchain still carries:
In the same file, cfg_select! did ship stable (#[stable(feature = "cfg_select", since = "1.95.0")]), confirming this is an assert_matches!‑specific slip, not a toolchain packaging issue.
Once assert_matches! lands on a stable release and our MSRV reaches that release, convert the 228 existing assert!(matches!(...)) call sites across the codebase:
Integration tests (3 files, ~13 sites)
tests/large_scale_debug.rs
tests/insert_with_statistics.rs
tests/tds_orientation.rs
Unit tests in src/ (28 files, ~215 sites); highest‑density:
Summary
Adopt the standard‑library
assert_matches!/debug_assert_matches!macros in unit and integration tests once they actually reach a stable Rust release.Background
Issue #324 (MSRV bump to Rust 1.95) listed this task:
The stabilization PR (rust‑lang/rust#137487, "Stabilize
assert_matches") was tagged milestone 1.95.0, but did not actually ship stable inrustc 1.95.0. The shipped library source for the 1.95.0 toolchain still carries:In the same file,
cfg_select!did ship stable (#[stable(feature = "cfg_select", since = "1.95.0")]), confirming this is anassert_matches!‑specific slip, not a toolchain packaging issue.Upstream tracking issue: rust‑lang/rust#82775.
Scope
Once
assert_matches!lands on a stable release and our MSRV reaches that release, convert the 228 existingassert!(matches!(...))call sites across the codebase:tests/large_scale_debug.rstests/insert_with_statistics.rstests/tds_orientation.rssrc/(28 files, ~215 sites); highest‑density:src/core/tds.rs(~45)src/core/triangulation.rs(~32)src/core/algorithms/locate.rs(~16)src/geometry/util/conversions.rs(~13)src/core/algorithms/flips.rs(~12)src/topology/traits/global_topology_model.rs(~11)The mechanical transformation is:
Import path (per 1.95 beta/stable docs once it lands):
Cases to leave alone (no direct replacement):
assert!(!matches!(...))— noassert_not_matches!exists; keep as‑is.Tasks
assert_matches!/debug_assert_matches!tests/src/just cito verifyReferences