From e88a7e2bb13dff55d1cca4662a9b13e3f1fb6f8d Mon Sep 17 00:00:00 2001 From: Homer Date: Fri, 10 Jul 2026 20:29:08 +0200 Subject: [PATCH] Fix float-literal fallback lints for Rust 1.97 rustc 1.97 promotes the float-literal type-fallback check on generic `impl Into` arguments (rust#154024) to a denied lint, which breaks the editor's `#![deny(warnings)]` build: every bare literal passed to `egui::Stroke::new` now needs an explicit type. Suffix the eleven affected literals with `_f32`; no behavior change. Co-Authored-By: Claude Fable 5 --- editor/src/shell.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/editor/src/shell.rs b/editor/src/shell.rs index de15de2..453f11e 100644 --- a/editor/src/shell.rs +++ b/editor/src/shell.rs @@ -2251,7 +2251,7 @@ impl<'a> ShellTabViewer<'a> { stroke_rect( &painter, tab_rect.shrink(1.5), - egui::Stroke::new(3.0, color), + egui::Stroke::new(3.0_f32, color), ); painter.text( tab_rect.left_top() + egui::vec2(8.0, 6.0), @@ -2312,7 +2312,7 @@ impl<'a> ShellTabViewer<'a> { egui::Color32::from_rgb(110, 220, 120) // green: solid }; let selected = self.state.selected == Some(entity); - let stroke = egui::Stroke::new(if selected { 2.0 } else { 1.2 }, color); + let stroke = egui::Stroke::new(if selected { 2.0_f32 } else { 1.2_f32 }, color); for (a, b) in collider_wire_segments(&col) { let (Some(pa), Some(pb)) = ( project(pose.transform_point(a), &overlay.view_proj, tab_rect), @@ -2344,7 +2344,7 @@ impl<'a> ShellTabViewer<'a> { project(viz.origin, &overlay.view_proj, tab_rect), project(viz.end, &overlay.view_proj, tab_rect), ) { - painter.line_segment([a, b], egui::Stroke::new(1.5, cyan)); + painter.line_segment([a, b], egui::Stroke::new(1.5_f32, cyan)); } // The hit surface: a dot at the contact point + a normal whisker. @@ -2359,7 +2359,7 @@ impl<'a> ShellTabViewer<'a> { project(hit.point, &overlay.view_proj, tab_rect), project(tip, &overlay.view_proj, tab_rect), ) { - painter.line_segment([a, b], egui::Stroke::new(2.0, magenta)); + painter.line_segment([a, b], egui::Stroke::new(2.0_f32, magenta)); } } } @@ -2470,7 +2470,7 @@ impl<'a> ShellTabViewer<'a> { ) else { return; }; - painter.line_segment([pa, pb], egui::Stroke::new(2.5, color)); + painter.line_segment([pa, pb], egui::Stroke::new(2.5_f32, color)); // Arrowhead at the tip — a small filled triangle perpendicular to // the line direction in screen space. let dir = (pb - pa).normalized(); @@ -2521,7 +2521,7 @@ impl<'a> ShellTabViewer<'a> { } else { egui::Color32::from_rgba_unmultiplied(255, 120, 120, if engaged { 220 } else { 130 }) }; - let stroke = egui::Stroke::new(1.5, color); + let stroke = egui::Stroke::new(1.5_f32, color); painter.add(egui::Shape::convex_polygon(projected, color, stroke)); } @@ -2551,7 +2551,7 @@ impl<'a> ShellTabViewer<'a> { return; } let color = axis_color(axis, engaged); - painter.add(egui::Shape::line(pts, egui::Stroke::new(2.0, color))); + painter.add(egui::Shape::line(pts, egui::Stroke::new(2.0_f32, color))); } fn hierarchy(&mut self, ui: &mut egui::Ui) { @@ -2705,7 +2705,7 @@ impl<'a> ShellTabViewer<'a> { DropZone::Child }; let accent = ui.visuals().selection.bg_fill; - let line = egui::Stroke::new(2.0, accent); + let line = egui::Stroke::new(2.0_f32, accent); match zone { DropZone::Before => { ui.painter().line_segment( @@ -3333,7 +3333,7 @@ impl<'a> ShellTabViewer<'a> { if r.contains(pos) { let above = (pos.y - r.top()) < r.height() / 2.0; let accent = ui.visuals().selection.bg_fill; - let line = egui::Stroke::new(2.0, accent); + let line = egui::Stroke::new(2.0_f32, accent); let y = if above { r.top() } else { r.bottom() }; ui.painter().line_segment( [egui::pos2(r.left(), y), egui::pos2(r.right(), y)], @@ -5165,7 +5165,7 @@ fn draw_ui_preview(ui: &mut egui::Ui, panel: &UiPanel) { stroke_rect( &painter, egui::Rect::from_min_size(origin, draw), - egui::Stroke::new(1.0, egui::Color32::DARK_GRAY), + egui::Stroke::new(1.0_f32, egui::Color32::DARK_GRAY), ); let theme = UiTheme::new();