Skip to content

fix: annotate float literals so the build is clean on Rust 1.97 - #9

Open
ayozetr wants to merge 1 commit into
RaidTheory:mainfrom
ayozetr:fix/float-literals-rust-1-97
Open

fix: annotate float literals so the build is clean on Rust 1.97#9
ayozetr wants to merge 1 commit into
RaidTheory:mainfrom
ayozetr:fix/float-literals-rust-1-97

Conversation

@ayozetr

@ayozetr ayozetr commented Aug 12, 2026

Copy link
Copy Markdown

cargo clippy --all-targets --locked -- -D warnings, the exact command in both CI jobs, fails on whatever dtolnay/rust-toolchain@stable currently resolves to (1.97.1) with 32 instances of:

falling back to `f32` as the trait bound `f32: From<f64>` is not satisfied

They are calls like Stroke::new(1.0, arc_border()), where the parameter is generic and an unsuffixed float literal no longer resolves the way it used to. rustc still accepts it but announces a future hard error, and -D warnings promotes it to a build failure today — so the job goes red on every PR regardless of what the PR touches.

I ran into this on the Linux job. The Windows one runs the identical command, and 27 of the 32 sit in theme.rs and widgets.rs, neither of which has any cfg(windows), so I would expect the same there — worth confirming, since I have no Windows machine to check on.

Mechanical change (1.01.0_f32) produced by cargo fix, which is where all 32 suggestions came from. Verified clean under 1.95 and 1.97 on Linux.

Sending this one on its own and first, since anything else lands red without it. Context in #8.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

CI runs `cargo clippy --all-targets --locked -- -D warnings` on whatever
`dtolnay/rust-toolchain@stable` resolves to, and on the current stable that
fails with 32 instances of:

    falling back to `f32` as the trait bound `f32: From<f64>` is not satisfied

They sit in calls like `Stroke::new(1.0, arc_border())`, where the parameter
is generic and an unsuffixed float literal no longer resolves the way it used
to. rustc still accepts it but announces it as a future hard error, and
`-D warnings` promotes it to a build failure today — so the Linux and Windows
jobs both go red on every pull request, whatever the pull request touches.

Mechanical change (`1.0` -> `1.0_f32`), produced by `cargo fix`, which is
where all 32 suggestions came from.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant