fix: annotate float literals so the build is clean on Rust 1.97 - #9
Open
ayozetr wants to merge 1 commit into
Open
fix: annotate float literals so the build is clean on Rust 1.97#9ayozetr wants to merge 1 commit into
ayozetr 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.