fix: annotate float literals so the build is clean on Rust 1.97 - #9
fix: annotate float literals so the build is clean on Rust 1.97#9ayozetr wants to merge 1 commit into
Conversation
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.
|
Heads-up on the red CI here, since it reads as "these patches are broken" and that is not what happened. All six PRs got a CI run on 12 Aug that failed with no jobs executed at all: The workflow was triggered, no runner was ever assigned, and the run was marked failed — so nothing was checked out, built or compiled. The API reports zero jobs on each of the six runs. That points at something on the runner or Actions-configuration side rather than anything in the branches, and it would presumably hit any fork PR the same way. You can see more of that than I can from outside. For what it is worth, each branch passes This PR specifically I have just re-checked against 1.98.1, today's stable and what One thing worth knowing if the runs ever do start: the other five will genuinely fail until this one lands. They branch off Happy to rebase, split or drop any of them — just say which. |
cargo clippy --all-targets --locked -- -D warnings, the exact command in both CI jobs, fails on whateverdtolnay/rust-toolchain@stablecurrently resolves to (1.97.1) with 32 instances of: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 warningspromotes 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.rsandwidgets.rs, neither of which has anycfg(windows), so I would expect the same there — worth confirming, since I have no Windows machine to check on.Mechanical change (
1.0→1.0_f32) produced bycargo 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.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.