fix: suffix f32 literals and deny future-incompatible warnings
Sixteen `Stroke::new(1.0, ...)` calls in the editor relied on a numeric
inference fallback that rustc is removing:
warning: falling back to `f32` as the trait bound `f32: From<f64>` is
not satisfied
= warning: this was previously accepted by the compiler but is being
phased out; it will become a hard error in a future release!
These were never clippy lints - a plain `cargo build` emitted all sixteen
- and they are not style. They are a dated compile break: the code stops
building on whichever release drops the fallback. Applied via `cargo fix`,
since rustc marks the suggestion machine-applicable; the diff is sixteen
literals gaining an `_f32` suffix and nothing else. The values were
already f32, just inferred.
Denying the future_incompatible group makes the next one a build failure
the day it appears rather than something that accumulates unnoticed until
a toolchain bump breaks the build on a day nobody chose. Verified by
reverting one literal: the build then fails with exit 101 instead of
warning.
Pinning rust-toolchain.toml was considered and rejected for this purpose.
It buys reproducibility, but it works against early warning - a pinned
toolchain finds out about the next deferred hard error later, not sooner.
Build warnings drop from 17 to 0. The 15 remaining clippy lints are
genuine style suggestions and are untouched, as is clippy's absence from
CI.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WHt4DykxXaQnyaJfyS8KCn
This commit is contained in:
@@ -17,6 +17,14 @@ members = ["xtask"]
|
|||||||
# `cdylib` is the plugin binary; `lib` (rlib) lets `cargo test` link the unit tests.
|
# `cdylib` is the plugin binary; `lib` (rlib) lets `cargo test` link the unit tests.
|
||||||
crate-type = ["cdylib", "lib"]
|
crate-type = ["cdylib", "lib"]
|
||||||
|
|
||||||
|
# Future-incompatibility warnings are deferred hard errors: rustc is telling you
|
||||||
|
# this code stops compiling on some later release. Denying the group turns that
|
||||||
|
# into a build failure the day it appears, rather than 16 of them accumulating
|
||||||
|
# unnoticed until a toolchain bump breaks the build on a day you did not choose.
|
||||||
|
# Style and clippy lints are deliberately untouched - they stay warnings.
|
||||||
|
[lints.rust]
|
||||||
|
future_incompatible = { level = "deny", priority = -1 }
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# Pinned to the exact commit of the local ./nih-plug reference clone so the build
|
# Pinned to the exact commit of the local ./nih-plug reference clone so the build
|
||||||
# is reproducible and matches the examples we read from. Bump the `rev` together
|
# is reproducible and matches the examples we read from. Bump the `rev` together
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ fn handle(
|
|||||||
}
|
}
|
||||||
|
|
||||||
let col = if resp.dragged() || resp.hovered() { palette::TEXT_HOVER } else { color };
|
let col = if resp.dragged() || resp.hovered() { palette::TEXT_HOVER } else { color };
|
||||||
p.line_segment([pos2(x, top), pos2(x, bottom)], Stroke::new(2.0, col));
|
p.line_segment([pos2(x, top), pos2(x, bottom)], Stroke::new(2.0_f32, col));
|
||||||
p.text(pos2(x, bottom - 1.0), Align2::CENTER_BOTTOM, fmt_hz(hz), FontId::proportional(10.0), palette::TEXT_BRIGHT);
|
p.text(pos2(x, bottom - 1.0), Align2::CENTER_BOTTOM, fmt_hz(hz), FontId::proportional(10.0), palette::TEXT_BRIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,14 +52,14 @@ pub(super) fn draw(ui: &mut egui::Ui, params: &Bari206Params, selected: usize, m
|
|||||||
let g6 = palette::GRID_FAINT;
|
let g6 = palette::GRID_FAINT;
|
||||||
let x6 = x_for(-6.0);
|
let x6 = x_for(-6.0);
|
||||||
let y6 = y_for(-6.0);
|
let y6 = y_for(-6.0);
|
||||||
p.line_segment([pos2(x6, top), pos2(x6, bottom)], Stroke::new(1.0, g6));
|
p.line_segment([pos2(x6, top), pos2(x6, bottom)], Stroke::new(1.0_f32, g6));
|
||||||
p.line_segment([pos2(left, y6), pos2(right, y6)], Stroke::new(1.0, g6));
|
p.line_segment([pos2(left, y6), pos2(right, y6)], Stroke::new(1.0_f32, g6));
|
||||||
|
|
||||||
// Unity reference (out = in), bottom-left to top-right.
|
// Unity reference (out = in), bottom-left to top-right.
|
||||||
p.line_segment([pos2(left, bottom), pos2(right, top)], Stroke::new(1.0, palette::GRID));
|
p.line_segment([pos2(left, bottom), pos2(right, top)], Stroke::new(1.0_f32, palette::GRID));
|
||||||
// Threshold marker on the input axis — shifted left by pre-gain (the comp sees in + pre).
|
// Threshold marker on the input axis — shifted left by pre-gain (the comp sees in + pre).
|
||||||
let tx = x_for((threshold - pre).clamp(FLOOR_DB, 0.0));
|
let tx = x_for((threshold - pre).clamp(FLOOR_DB, 0.0));
|
||||||
p.line_segment([pos2(tx, top), pos2(tx, bottom)], Stroke::new(1.0, palette::THRESHOLD_LINE));
|
p.line_segment([pos2(tx, top), pos2(tx, bottom)], Stroke::new(1.0_f32, palette::THRESHOLD_LINE));
|
||||||
|
|
||||||
// Full wet transfer: drive into the comp, then makeup. (Mix not folded in.)
|
// Full wet transfer: drive into the comp, then makeup. (Mix not folded in.)
|
||||||
let n = 96;
|
let n = 96;
|
||||||
@@ -93,7 +93,7 @@ pub(super) fn draw(ui: &mut egui::Ui, params: &Bari206Params, selected: usize, m
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
p.add(egui::Shape::line(pts, Stroke::new(1.6, palette::CURVE)));
|
p.add(egui::Shape::line(pts, Stroke::new(1.6_f32, palette::CURVE)));
|
||||||
|
|
||||||
// Operating-point dot, on the curve at the current input.
|
// Operating-point dot, on the curve at the current input.
|
||||||
let driven = ext_in + pre;
|
let driven = ext_in + pre;
|
||||||
|
|||||||
@@ -243,23 +243,23 @@ pub fn apply_visuals(ctx: &nih_plug_egui::egui::Context) {
|
|||||||
let w = &mut v.widgets;
|
let w = &mut v.widgets;
|
||||||
w.noninteractive.bg_fill = SURFACE_RAISED;
|
w.noninteractive.bg_fill = SURFACE_RAISED;
|
||||||
w.noninteractive.weak_bg_fill = SURFACE_RAISED;
|
w.noninteractive.weak_bg_fill = SURFACE_RAISED;
|
||||||
w.noninteractive.bg_stroke = Stroke::new(1.0, GRID_FAINT);
|
w.noninteractive.bg_stroke = Stroke::new(1.0_f32, GRID_FAINT);
|
||||||
w.noninteractive.fg_stroke = Stroke::new(1.0, TEXT);
|
w.noninteractive.fg_stroke = Stroke::new(1.0_f32, TEXT);
|
||||||
|
|
||||||
w.inactive.bg_fill = TRACK;
|
w.inactive.bg_fill = TRACK;
|
||||||
w.inactive.weak_bg_fill = TRACK;
|
w.inactive.weak_bg_fill = TRACK;
|
||||||
w.inactive.bg_stroke = Stroke::new(1.0, GRID);
|
w.inactive.bg_stroke = Stroke::new(1.0_f32, GRID);
|
||||||
w.inactive.fg_stroke = Stroke::new(1.0, TEXT_BRIGHT);
|
w.inactive.fg_stroke = Stroke::new(1.0_f32, TEXT_BRIGHT);
|
||||||
|
|
||||||
w.hovered.bg_fill = accent.edge;
|
w.hovered.bg_fill = accent.edge;
|
||||||
w.hovered.weak_bg_fill = accent.strip;
|
w.hovered.weak_bg_fill = accent.strip;
|
||||||
w.hovered.bg_stroke = Stroke::new(1.0, accent.edge);
|
w.hovered.bg_stroke = Stroke::new(1.0_f32, accent.edge);
|
||||||
w.hovered.fg_stroke = Stroke::new(1.0, TEXT_HOVER);
|
w.hovered.fg_stroke = Stroke::new(1.0_f32, TEXT_HOVER);
|
||||||
|
|
||||||
w.active.bg_fill = accent.handle;
|
w.active.bg_fill = accent.handle;
|
||||||
w.active.weak_bg_fill = accent.edge;
|
w.active.weak_bg_fill = accent.edge;
|
||||||
w.active.bg_stroke = Stroke::new(1.0, accent.handle);
|
w.active.bg_stroke = Stroke::new(1.0_f32, accent.handle);
|
||||||
w.active.fg_stroke = Stroke::new(1.0, TEXT_HOVER);
|
w.active.fg_stroke = Stroke::new(1.0_f32, TEXT_HOVER);
|
||||||
|
|
||||||
ctx.set_visuals(v);
|
ctx.set_visuals(v);
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -170,7 +170,7 @@ pub(super) fn draw(ui: &mut egui::Ui, meters: &Meters, state: &mut PlotState) {
|
|||||||
// Gridlines (dB).
|
// Gridlines (dB).
|
||||||
for &g in &[0.0f32, -12.0, -24.0, -48.0] {
|
for &g in &[0.0f32, -12.0, -24.0, -48.0] {
|
||||||
let y = y_for_db(g);
|
let y = y_for_db(g);
|
||||||
p.line_segment([pos2(left, y), pos2(right, y)], Stroke::new(1.0, palette::GRID_FAINT));
|
p.line_segment([pos2(left, y), pos2(right, y)], Stroke::new(1.0_f32, palette::GRID_FAINT));
|
||||||
p.text(
|
p.text(
|
||||||
pos2(left + 2.0, y),
|
pos2(left + 2.0, y),
|
||||||
Align2::LEFT_BOTTOM,
|
Align2::LEFT_BOTTOM,
|
||||||
@@ -204,7 +204,7 @@ pub(super) fn draw(ui: &mut egui::Ui, meters: &Meters, state: &mut PlotState) {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
p.add(egui::Shape::line(pts, Stroke::new(1.5, color)));
|
p.add(egui::Shape::line(pts, Stroke::new(1.5_f32, color)));
|
||||||
};
|
};
|
||||||
draw_series(&state.history.in_db[c], &|db| db, COLOR_IN, true);
|
draw_series(&state.history.in_db[c], &|db| db, COLOR_IN, true);
|
||||||
draw_series(&state.history.out_db[c], &|db| db, COLOR_OUT, true);
|
draw_series(&state.history.out_db[c], &|db| db, COLOR_OUT, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user