Skip to content

fix(ui): suffix slider step literals to satisfy float_literal_f32_fallback#265

Merged
OpenSauce merged 1 commit into
mainfrom
fix/float-literal-f32-fallback
Jul 14, 2026
Merged

fix(ui): suffix slider step literals to satisfy float_literal_f32_fallback#265
OpenSauce merged 1 commit into
mainfrom
fix/float-literal-f32-fallback

Conversation

@OpenSauce

Copy link
Copy Markdown
Owner

Problem

CI's Lint job is failing on main and on every open PR (e.g. #264, a dependabot bump that has nothing to do with these files):

error: falling back to `f32` as the trait bound `f32: From<f64>` is not satisfied
   --> rustortion-ui/src/app.rs:549:23
    |
549 |                 .step(1.0),
    |                       ^^^ help: explicitly specify the type as `f32`: `1.0_f32`
    |
    = note: `-D float-literal-f32-fallback` implied by `-D warnings`
error: could not compile `rustortion-ui` (lib) due to 3 previous errors

This is toolchain drift, not a code regression. CI uses dtolnay/rust-toolchain@stable, which now resolves to 1.97.0. That release adds the future-incompatible lint float_literal_f32_fallback, which fires on unsuffixed float literals whose type is only settled by inference fallback. Our -D warnings turns it into a hard error.

Fix

Suffix the three affected slider .step() literals as _f32 — exactly what rustc suggests.

  • rustortion-ui/src/app.rs — HP and LP cutoff sliders
  • rustortion-ui/src/components/ir_cabinet_control.rs — IR gain slider

No behaviour change. These literals already resolved to f32; the suffix just states it explicitly instead of leaning on fallback.

Verification

The lint doesn't exist on older toolchains, so a local make lint on 1.95 passes even without this fix — it can't prove anything. Verified against 1.97 specifically, matching CI:

$ rustc +1.97 -W help | grep float-literal
  float-literal-f32-fallback  warn  detects unsuffixed floating point literals whose type fallback to `f32`

$ cargo +1.97 clippy --workspace --all-targets --all-features -- \
    -D warnings -D clippy::all -D clippy::pedantic -D clippy::nursery
    Finished `dev` profile [optimized + debuginfo] target(s) in 16.86s

$ cargo +1.97 fmt --all -- --check
(clean)

Note on #264

#264 needs this on main and then a rebase — its own diff is unrelated. Once this lands, dependabot will rebase and its Lint job should go green.

…lback

New stable rustc (1.97) adds the future-incompatible
`float_literal_f32_fallback` lint, which fires on unsuffixed float
literals whose type resolves to f32 only via inference fallback. Under
CI's `-D warnings` this breaks the Lint job on every PR, including
unrelated dependabot ones.

Suffix the three affected slider `.step()` literals as `_f32`. No
behaviour change - the literals already resolved to f32.
Copilot AI review requested due to automatic review settings July 14, 2026 07:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes CI lint failures introduced by Rust toolchain drift (stable → 1.97), where -D float-literal-f32-fallback turns unsuffixed float literals in slider .step() calls into hard errors. It resolves the issue by explicitly suffixing the affected .step() literals with _f32, matching rustc’s suggestion and preserving behavior.

Changes:

  • Add _f32 suffix to the HP cutoff slider step literal in SharedApp::view_io_tab.
  • Add _f32 suffix to the LP cutoff slider step literal in SharedApp::view_io_tab.
  • Add _f32 suffix to the IR gain slider step literal in IrCabinetControl.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
rustortion-ui/src/app.rs Suffixes the HP/LP cutoff slider .step() literals with _f32 to satisfy the new lint on Rust 1.97.
rustortion-ui/src/components/ir_cabinet_control.rs Suffixes the IR gain slider .step() literal with _f32 to satisfy the new lint on Rust 1.97.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@OpenSauce
OpenSauce enabled auto-merge (squash) July 14, 2026 08:02
@OpenSauce
OpenSauce merged commit 1a79a34 into main Jul 14, 2026
8 checks passed
@OpenSauce
OpenSauce deleted the fix/float-literal-f32-fallback branch July 14, 2026 08:03
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.

2 participants