Skip to content

Clippy fails on rustc 1.99: deprecated std::f32::EPSILON in vector.rs tests blocks all local commits #557

Description

@ajianaz

What

cargo clippy --all-targets -- -D warnings fails on develop (4 errors) with current stable rustc (1.99.0, 2026-09-28), in src/index/vector.rs tests:

error: use of deprecated constant `std::f32::EPSILON`: replaced by the `EPSILON` associated constant on `f32`
   --> src/index/vector.rs:905:73 (x4, lines 905-908)

Root cause: the tests module does use std::f32; (line 622), which makes bare f32::EPSILON resolve to the deprecated module-path constant. GitHub CI is still green because its floating dtolnay/rust-toolchain@stable lags local 1.99 — it will break CI the day the runner's stable catches up.

Blast radius: the repo's pre-commit hook runs clippy, so EVERY commit on a machine with rustc ≥ 1.99 is blocked (verified today while committing an unrelated fix — had to abort).

Why

Keep local toolchains and CI in agreement; unblock pre-commit commits on current stable.

Suggested fix

Delete the use std::f32; import at src/index/vector.rs:622 — the primitive f32 is always in scope, so f32::EPSILON then resolves to the associated constant (exists since Rust 1.43, works on old and new toolchains alike). One line, zero behavior change.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions