From 8d98763fe17e9f98d4bb8526d673d51a84514c33 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Fri, 19 Dec 2025 20:55:50 +0100 Subject: [PATCH] Replace `#[allow` attributes with `expect` (#7796) We do have `clippy::allow_attributes` turned on, but it doesn't seem to work properly --- crates/ecolor/src/hsva.rs | 8 ++++---- crates/ecolor/src/lib.rs | 2 +- crates/eframe/src/lib.rs | 3 +-- crates/eframe/src/native/app_icon.rs | 4 ++-- crates/eframe/src/native/run.rs | 4 ---- crates/eframe/src/native/wgpu_integration.rs | 2 +- crates/eframe/src/stopwatch.rs | 2 +- crates/eframe/src/web/app_runner.rs | 2 +- crates/eframe/src/web/web_logger.rs | 4 ++-- crates/eframe/src/web/web_painter_glow.rs | 2 +- crates/egui-wgpu/src/capture.rs | 4 ++-- crates/egui-wgpu/src/lib.rs | 4 +--- crates/egui-wgpu/src/setup.rs | 2 +- crates/egui-wgpu/src/winit.rs | 1 + crates/egui-winit/src/clipboard.rs | 2 +- crates/egui-winit/src/lib.rs | 2 +- crates/egui-winit/src/safe_area.rs | 2 +- crates/egui/src/atomics/atoms.rs | 3 +-- crates/egui/src/containers/old_popup.rs | 2 +- crates/egui/src/containers/scroll_area.rs | 2 +- crates/egui/src/context.rs | 2 +- crates/egui/src/hit_test.rs | 2 +- crates/egui/src/lib.rs | 4 ++-- crates/egui/src/memory/theme.rs | 2 +- crates/egui/src/menu.rs | 2 +- crates/egui/src/style.rs | 2 -- crates/egui/src/ui.rs | 2 +- crates/egui/src/util/id_type_map.rs | 4 ++-- crates/egui/src/widgets/color_picker.rs | 2 +- crates/egui/src/widgets/drag_value.rs | 2 +- crates/egui/src/widgets/slider.rs | 2 +- crates/egui_demo_app/src/apps/custom3d_glow.rs | 2 +- crates/egui_demo_app/src/main.rs | 4 ++-- crates/egui_demo_app/src/web.rs | 4 +--- crates/egui_demo_app/src/wrap_app.rs | 2 +- crates/egui_demo_lib/src/demo/widget_gallery.rs | 2 +- crates/egui_extras/src/lib.rs | 3 +-- crates/egui_extras/src/loaders/svg_loader.rs | 2 +- crates/egui_extras/src/syntax_highlighting.rs | 6 +++--- crates/egui_extras/src/table.rs | 2 +- crates/egui_glow/src/lib.rs | 4 +--- crates/egui_glow/src/misc_util.rs | 2 +- crates/egui_glow/src/painter.rs | 5 ++--- crates/emath/src/lib.rs | 2 +- crates/emath/src/numeric.rs | 4 ++-- crates/epaint/src/lib.rs | 4 ++-- crates/epaint/src/margin.rs | 2 +- crates/epaint/src/mesh.rs | 2 +- crates/epaint/src/mutex.rs | 4 ++-- crates/epaint/src/shape_transform.rs | 2 +- crates/epaint/src/shapes/bezier_shape.rs | 3 +-- crates/epaint/src/stroke.rs | 2 -- crates/epaint/src/tessellator.rs | 4 ++-- crates/epaint/src/text/font.rs | 2 +- crates/epaint/src/text/text_layout_types.rs | 3 --- examples/confirm_exit/src/main.rs | 2 +- examples/custom_3d_glow/src/main.rs | 6 +++--- examples/custom_font/src/main.rs | 2 +- examples/custom_font_style/src/main.rs | 2 +- examples/custom_keypad/src/main.rs | 2 +- examples/custom_style/src/main.rs | 2 +- examples/external_eventloop_async/src/main.rs | 2 +- examples/file_dialog/src/main.rs | 2 +- examples/hello_world/src/main.rs | 2 +- examples/hello_world_simple/src/main.rs | 2 +- examples/images/src/main.rs | 2 +- examples/keyboard_events/src/main.rs | 2 +- examples/multiple_viewports/src/main.rs | 2 +- examples/popups/src/main.rs | 2 +- examples/puffin_profiler/src/main.rs | 2 +- examples/serial_windows/src/main.rs | 2 +- examples/user_attention/src/main.rs | 2 +- tests/test_size_pass/src/main.rs | 2 +- tests/test_ui_stack/src/main.rs | 2 +- xtask/src/main.rs | 3 +-- 75 files changed, 89 insertions(+), 111 deletions(-) diff --git a/crates/ecolor/src/hsva.rs b/crates/ecolor/src/hsva.rs index 06adb121f..17008f5da 100644 --- a/crates/ecolor/src/hsva.rs +++ b/crates/ecolor/src/hsva.rs @@ -41,7 +41,7 @@ impl Hsva { /// From linear RGBA with premultiplied alpha #[inline] pub fn from_rgba_premultiplied(r: f32, g: f32, b: f32, a: f32) -> Self { - #![allow(clippy::many_single_char_names)] + #![expect(clippy::many_single_char_names)] if a <= 0.0 { if r == 0.0 && b == 0.0 && a == 0.0 { Self::default() @@ -57,7 +57,7 @@ impl Hsva { /// From linear RGBA without premultiplied alpha #[inline] pub fn from_rgba_unmultiplied(r: f32, g: f32, b: f32, a: f32) -> Self { - #![allow(clippy::many_single_char_names)] + #![expect(clippy::many_single_char_names)] let (h, s, v) = hsv_from_rgb([r, g, b]); Self { h, s, v, a } } @@ -189,7 +189,7 @@ impl From for Hsva { /// All ranges in 0-1, rgb is linear. #[inline] pub fn hsv_from_rgb([r, g, b]: [f32; 3]) -> (f32, f32, f32) { - #![allow(clippy::many_single_char_names)] + #![expect(clippy::many_single_char_names)] let min = r.min(g.min(b)); let max = r.max(g.max(b)); // value @@ -213,7 +213,7 @@ pub fn hsv_from_rgb([r, g, b]: [f32; 3]) -> (f32, f32, f32) { /// All ranges in 0-1, rgb is linear. #[inline] pub fn rgb_from_hsv((h, s, v): (f32, f32, f32)) -> [f32; 3] { - #![allow(clippy::many_single_char_names)] + #![expect(clippy::many_single_char_names)] let h = (h.fract() + 1.0).fract(); // wrap let s = s.clamp(0.0, 1.0); diff --git a/crates/ecolor/src/lib.rs b/crates/ecolor/src/lib.rs index f4cdf4d77..ea7cff6f7 100644 --- a/crates/ecolor/src/lib.rs +++ b/crates/ecolor/src/lib.rs @@ -19,7 +19,7 @@ #![cfg_attr(feature = "document-features", doc = document_features::document_features!())] //! -#![allow(clippy::wrong_self_convention)] +#![expect(clippy::wrong_self_convention)] #[cfg(feature = "cint")] mod cint_impl; diff --git a/crates/eframe/src/lib.rs b/crates/eframe/src/lib.rs index 252320462..151fb79ce 100644 --- a/crates/eframe/src/lib.rs +++ b/crates/eframe/src/lib.rs @@ -142,7 +142,6 @@ //! #![warn(missing_docs)] // let's keep eframe well-documented -#![allow(clippy::needless_doctest_main)] // Limitation imposed by `accesskit_winit`: // https://github.com/AccessKit/accesskit/tree/accesskit-v0.18.0/platforms/winit#android-activity-compatibility` @@ -253,7 +252,7 @@ pub mod icon_data; /// This function can fail if we fail to set up a graphics context. #[cfg(not(target_arch = "wasm32"))] #[cfg(any(feature = "glow", feature = "wgpu_no_default_features"))] -#[allow(clippy::needless_pass_by_value, clippy::allow_attributes)] +#[allow(clippy::allow_attributes, clippy::needless_pass_by_value)] pub fn run_native( app_name: &str, mut native_options: NativeOptions, diff --git a/crates/eframe/src/native/app_icon.rs b/crates/eframe/src/native/app_icon.rs index 233bf4c9d..3ac61d8e6 100644 --- a/crates/eframe/src/native/app_icon.rs +++ b/crates/eframe/src/native/app_icon.rs @@ -47,7 +47,7 @@ enum AppIconStatus { NotSetTryAgain, /// We successfully set the icon and it should be visible now. - #[allow(dead_code, clippy::allow_attributes)] // Not used on Linux + #[allow(clippy::allow_attributes, dead_code)] // Not used on Linux Set, } @@ -71,7 +71,7 @@ fn set_title_and_icon(_title: &str, _icon_data: Option<&IconData>) -> AppIconSta #[cfg(target_os = "macos")] return set_title_and_icon_mac(_title, _icon_data); - #[allow(unreachable_code, clippy::allow_attributes)] + #[allow(clippy::allow_attributes, unreachable_code)] AppIconStatus::NotSetIgnored } diff --git a/crates/eframe/src/native/run.rs b/crates/eframe/src/native/run.rs index 7a3a8b4c4..0597d318c 100644 --- a/crates/eframe/src/native/run.rs +++ b/crates/eframe/src/native/run.rs @@ -349,8 +349,6 @@ pub fn run_glow( mut native_options: epi::NativeOptions, app_creator: epi::AppCreator<'_>, ) -> Result { - #![allow(clippy::needless_return_with_question_mark)] // False positive - use super::glow_integration::GlowWinitApp; #[cfg(not(target_os = "ios"))] @@ -387,8 +385,6 @@ pub fn run_wgpu( mut native_options: epi::NativeOptions, app_creator: epi::AppCreator<'_>, ) -> Result { - #![allow(clippy::needless_return_with_question_mark)] // False positive - use super::wgpu_integration::WgpuWinitApp; #[cfg(not(target_os = "ios"))] diff --git a/crates/eframe/src/native/wgpu_integration.rs b/crates/eframe/src/native/wgpu_integration.rs index 5444e9cf3..cb634200a 100644 --- a/crates/eframe/src/native/wgpu_integration.rs +++ b/crates/eframe/src/native/wgpu_integration.rs @@ -256,7 +256,7 @@ impl<'app> WgpuWinitApp<'app> { }); } - #[allow(unused_mut, clippy::allow_attributes)] // used for accesskit + #[allow(clippy::allow_attributes, unused_mut)] // used for accesskit let mut egui_winit = egui_winit::State::new( egui_ctx.clone(), ViewportId::ROOT, diff --git a/crates/eframe/src/stopwatch.rs b/crates/eframe/src/stopwatch.rs index 9e0db2a48..b5f956c82 100644 --- a/crates/eframe/src/stopwatch.rs +++ b/crates/eframe/src/stopwatch.rs @@ -1,4 +1,4 @@ -#![allow(dead_code)] // not everything is used on wasm +#![allow(clippy::allow_attributes, dead_code)] // not used on all platforms use web_time::Instant; diff --git a/crates/eframe/src/web/app_runner.rs b/crates/eframe/src/web/app_runner.rs index b1a19a882..11654135d 100644 --- a/crates/eframe/src/web/app_runner.rs +++ b/crates/eframe/src/web/app_runner.rs @@ -7,7 +7,7 @@ use crate::{App, epi, web::web_painter::WebPainter}; use super::{NeedRepaint, now_sec, text_agent::TextAgent}; pub struct AppRunner { - #[allow(dead_code, clippy::allow_attributes)] + #[allow(clippy::allow_attributes, dead_code)] pub(crate) web_options: crate::WebOptions, pub(crate) frame: epi::Frame, egui_ctx: egui::Context, diff --git a/crates/eframe/src/web/web_logger.rs b/crates/eframe/src/web/web_logger.rs index 01c347b7e..882f3e5de 100644 --- a/crates/eframe/src/web/web_logger.rs +++ b/crates/eframe/src/web/web_logger.rs @@ -38,7 +38,7 @@ impl log::Log for WebLogger { } fn log(&self, record: &log::Record<'_>) { - #![allow(clippy::match_same_arms)] + #![expect(clippy::match_same_arms)] if !self.enabled(record.metadata()) { return; @@ -110,7 +110,7 @@ mod console { /// * `tokio-1.24.1/src/runtime/runtime.rs` /// * `rerun/src/main.rs` /// * `core/src/ops/function.rs` -#[allow(dead_code, clippy::allow_attributes)] // only used on web and in tests +#[allow(clippy::allow_attributes, dead_code)] // only used on web and in tests fn shorten_file_path(file_path: &str) -> &str { if let Some(i) = file_path.rfind("/src/") { if let Some(prev_slash) = file_path[..i].rfind('/') { diff --git a/crates/eframe/src/web/web_painter_glow.rs b/crates/eframe/src/web/web_painter_glow.rs index 562a51c29..470fa40d3 100644 --- a/crates/eframe/src/web/web_painter_glow.rs +++ b/crates/eframe/src/web/web_painter_glow.rs @@ -28,7 +28,7 @@ impl WebPainterGlow { let (gl, shader_prefix) = init_glow_context_from_canvas(&canvas, options.webgl_context_option)?; - #[allow(clippy::arc_with_non_send_sync, clippy::allow_attributes)] // For wasm + #[allow(clippy::allow_attributes, clippy::arc_with_non_send_sync)] // For wasm let gl = std::sync::Arc::new(gl); let painter = egui_glow::Painter::new(gl, shader_prefix, None, options.dithering) diff --git a/crates/egui-wgpu/src/capture.rs b/crates/egui-wgpu/src/capture.rs index f0781d97c..58407fdd6 100644 --- a/crates/egui-wgpu/src/capture.rs +++ b/crates/egui-wgpu/src/capture.rs @@ -126,7 +126,7 @@ impl CaptureState { // It would be more efficient to reuse the Buffer, e.g. via some kind of ring buffer, but // for most screenshot use cases this should be fine. When taking many screenshots (e.g. for a video) // it might make sense to revisit this and implement a more efficient solution. - #[allow(clippy::arc_with_non_send_sync, clippy::allow_attributes)] // For wasm + #[allow(clippy::allow_attributes, clippy::arc_with_non_send_sync)] // For wasm let buffer = device.create_buffer(&wgpu::BufferDescriptor { label: Some("egui_screen_capture_buffer"), size: (self.padding.padded_bytes_per_row * self.texture.height()) as u64, @@ -186,7 +186,7 @@ impl CaptureState { tx: CaptureSender, viewport_id: ViewportId, ) { - #[allow(clippy::arc_with_non_send_sync, clippy::allow_attributes)] // For wasm + #[allow(clippy::allow_attributes, clippy::arc_with_non_send_sync)] // For wasm let buffer = Arc::new(buffer); let buffer_clone = Arc::clone(&buffer); let buffer_slice = buffer_clone.slice(..); diff --git a/crates/egui-wgpu/src/lib.rs b/crates/egui-wgpu/src/lib.rs index d340526af..880ab8f4a 100644 --- a/crates/egui-wgpu/src/lib.rs +++ b/crates/egui-wgpu/src/lib.rs @@ -16,8 +16,6 @@ #![doc = document_features::document_features!()] //! -#![allow(unsafe_code)] - pub use wgpu; /// Low-level painting of [`egui`](https://github.com/emilk/egui) on [`wgpu`]. @@ -247,7 +245,7 @@ impl RenderState { // On wasm, depending on feature flags, wgpu objects may or may not implement sync. // It doesn't make sense to switch to Rc for that special usecase, so simply disable the lint. - #[allow(clippy::arc_with_non_send_sync, clippy::allow_attributes)] // For wasm + #[allow(clippy::allow_attributes, clippy::arc_with_non_send_sync)] // For wasm Ok(Self { adapter, #[cfg(not(target_arch = "wasm32"))] diff --git a/crates/egui-wgpu/src/setup.rs b/crates/egui-wgpu/src/setup.rs index 17498923d..0c3cb8c39 100644 --- a/crates/egui-wgpu/src/setup.rs +++ b/crates/egui-wgpu/src/setup.rs @@ -48,7 +48,7 @@ impl WgpuSetup { pub async fn new_instance(&self) -> wgpu::Instance { match self { Self::CreateNew(create_new) => { - #[allow(unused_mut, clippy::allow_attributes)] + #[allow(clippy::allow_attributes, unused_mut)] let mut backends = create_new.instance_descriptor.backends; // Don't try WebGPU if we're not in a secure context. diff --git a/crates/egui-wgpu/src/winit.rs b/crates/egui-wgpu/src/winit.rs index 5f277b3db..167d10c79 100644 --- a/crates/egui-wgpu/src/winit.rs +++ b/crates/egui-wgpu/src/winit.rs @@ -1,6 +1,7 @@ #![expect(clippy::missing_errors_doc)] #![expect(clippy::undocumented_unsafe_blocks)] #![expect(clippy::unwrap_used)] // TODO(emilk): avoid unwraps +#![expect(unsafe_code)] use crate::{RenderState, SurfaceErrorAction, WgpuConfiguration, renderer}; use crate::{ diff --git a/crates/egui-winit/src/clipboard.rs b/crates/egui-winit/src/clipboard.rs index fc7334388..75d0469ec 100644 --- a/crates/egui-winit/src/clipboard.rs +++ b/crates/egui-winit/src/clipboard.rs @@ -175,7 +175,7 @@ fn init_arboard() -> Option { fn init_smithay_clipboard( raw_display_handle: Option, ) -> Option { - #![allow(clippy::undocumented_unsafe_blocks)] + #![expect(clippy::undocumented_unsafe_blocks)] profiling::function_scope!(); diff --git a/crates/egui-winit/src/lib.rs b/crates/egui-winit/src/lib.rs index 6663ba40f..7cbaec624 100644 --- a/crates/egui-winit/src/lib.rs +++ b/crates/egui-winit/src/lib.rs @@ -7,7 +7,7 @@ #![cfg_attr(feature = "document-features", doc = document_features::document_features!())] //! -#![allow(clippy::manual_range_contains)] +#![expect(clippy::manual_range_contains)] #[cfg(feature = "accesskit")] pub use accesskit_winit; diff --git a/crates/egui-winit/src/safe_area.rs b/crates/egui-winit/src/safe_area.rs index d29d654a3..5f4a9f9cf 100644 --- a/crates/egui-winit/src/safe_area.rs +++ b/crates/egui-winit/src/safe_area.rs @@ -25,7 +25,7 @@ mod ios { let app = UIApplication::sharedApplication(main_thread_marker); - #[allow(unsafe_code)] + #[expect(unsafe_code)] unsafe { // Look for the first window scene that's in the foreground for scene in app.connectedScenes() { diff --git a/crates/egui/src/atomics/atoms.rs b/crates/egui/src/atomics/atoms.rs index 4b19c9e26..1db7c63c6 100644 --- a/crates/egui/src/atomics/atoms.rs +++ b/crates/egui/src/atomics/atoms.rs @@ -198,8 +198,7 @@ macro_rules! all_the_atoms { $($T: IntoAtoms<'a>),* { fn collect(self, _atoms: &mut Atoms<'a>) { - #[allow(clippy::allow_attributes)] - #[allow(non_snake_case)] + #[allow(clippy::allow_attributes, non_snake_case)] let ($($T),*) = self; $($T.collect(_atoms);)* } diff --git a/crates/egui/src/containers/old_popup.rs b/crates/egui/src/containers/old_popup.rs index 3ddf77bf6..f8e7cc900 100644 --- a/crates/egui/src/containers/old_popup.rs +++ b/crates/egui/src/containers/old_popup.rs @@ -1,5 +1,5 @@ //! Old and deprecated API for popups. Use [`Popup`] instead. -#![allow(deprecated)] +#![expect(deprecated)] use crate::containers::tooltip::Tooltip; use crate::{ diff --git a/crates/egui/src/containers/scroll_area.rs b/crates/egui/src/containers/scroll_area.rs index 6e6fb18b8..a9753b04b 100644 --- a/crates/egui/src/containers/scroll_area.rs +++ b/crates/egui/src/containers/scroll_area.rs @@ -1,6 +1,6 @@ //! See [`ScrollArea`] for docs. -#![allow(clippy::needless_range_loop)] +#![expect(clippy::needless_range_loop)] use std::ops::{Add, AddAssign, BitOr, BitOrAssign}; diff --git a/crates/egui/src/context.rs b/crates/egui/src/context.rs index 1c4fc4b58..8691c96e5 100644 --- a/crates/egui/src/context.rs +++ b/crates/egui/src/context.rs @@ -1254,7 +1254,7 @@ impl Context { self.check_for_id_clash(w.id, w.rect, "widget"); } - #[allow(clippy::let_and_return, clippy::allow_attributes)] + #[allow(clippy::allow_attributes, clippy::let_and_return)] let res = self.get_response(w); #[cfg(debug_assertions)] diff --git a/crates/egui/src/hit_test.rs b/crates/egui/src/hit_test.rs index 3cb225e44..a31196635 100644 --- a/crates/egui/src/hit_test.rs +++ b/crates/egui/src/hit_test.rs @@ -201,7 +201,7 @@ fn contains_circle(interact_rect: emath::Rect, pos: Pos2, radius: f32) -> bool { } fn hit_test_on_close(close: &[WidgetRect], pos: Pos2) -> WidgetHits { - #![allow(clippy::collapsible_else_if)] + #![expect(clippy::collapsible_else_if)] // First find the best direct hits: let hit_click = find_closest_within( diff --git a/crates/egui/src/lib.rs b/crates/egui/src/lib.rs index dbe8be16d..e26380c6f 100644 --- a/crates/egui/src/lib.rs +++ b/crates/egui/src/lib.rs @@ -385,8 +385,8 @@ //! egui apps can run significantly (~20%) faster by using a custom allocator, like [mimalloc](https://crates.io/crates/mimalloc) or [talc](https://crates.io/crates/talc). //! -#![allow(clippy::float_cmp)] -#![allow(clippy::manual_range_contains)] +#![expect(clippy::float_cmp)] +#![expect(clippy::manual_range_contains)] mod animation_manager; mod atomics; diff --git a/crates/egui/src/memory/theme.rs b/crates/egui/src/memory/theme.rs index cd621009d..c426cc93e 100644 --- a/crates/egui/src/memory/theme.rs +++ b/crates/egui/src/memory/theme.rs @@ -39,7 +39,7 @@ impl Theme { /// This is not the best design as it doesn't allow switching back to "follow system". #[must_use] pub(crate) fn small_toggle_button(self, ui: &mut crate::Ui) -> Option { - #![allow(clippy::collapsible_else_if)] + #![expect(clippy::collapsible_else_if)] if self == Self::Dark { if ui .add(Button::new("☀").frame(false)) diff --git a/crates/egui/src/menu.rs b/crates/egui/src/menu.rs index d8366acfc..7c562d726 100644 --- a/crates/egui/src/menu.rs +++ b/crates/egui/src/menu.rs @@ -1,4 +1,4 @@ -#![allow(deprecated)] +#![expect(deprecated)] //! Deprecated menu API - Use [`crate::containers::menu`] instead. //! //! Usage: diff --git a/crates/egui/src/style.rs b/crates/egui/src/style.rs index b0cff0019..fe33827ff 100644 --- a/crates/egui/src/style.rs +++ b/crates/egui/src/style.rs @@ -1,7 +1,5 @@ //! egui theme (spacing, colors, etc). -#![allow(clippy::if_same_then_else)] - use emath::Align; use epaint::{AlphaFromCoverage, CornerRadius, Shadow, Stroke, TextOptions, text::FontTweak}; use std::{collections::BTreeMap, ops::RangeInclusive, sync::Arc}; diff --git a/crates/egui/src/ui.rs b/crates/egui/src/ui.rs index d5c09e067..8535388a9 100644 --- a/crates/egui/src/ui.rs +++ b/crates/egui/src/ui.rs @@ -1,5 +1,5 @@ #![warn(missing_docs)] // Let's keep `Ui` well-documented. -#![allow(clippy::use_self)] +#![expect(clippy::use_self)] use std::{any::Any, hash::Hash, ops::Deref, sync::Arc}; diff --git a/crates/egui/src/util/id_type_map.rs b/crates/egui/src/util/id_type_map.rs index eed0cf2eb..b1312a1da 100644 --- a/crates/egui/src/util/id_type_map.rs +++ b/crates/egui/src/util/id_type_map.rs @@ -484,7 +484,7 @@ impl IdTypeMap { /// For tests #[cfg(feature = "persistence")] - #[allow(unused, clippy::allow_attributes)] + #[allow(clippy::allow_attributes, unused)] fn get_generation(&self, id: Id) -> Option { let element = self.map.get(&hash(TypeId::of::(), id))?; match element { @@ -724,7 +724,7 @@ fn test_two_id_two_type() { #[test] fn test_two_id_x_two_types() { - #![allow(clippy::approx_constant)] + #![expect(clippy::approx_constant)] let a = Id::new("a"); let b = Id::new("b"); diff --git a/crates/egui/src/widgets/color_picker.rs b/crates/egui/src/widgets/color_picker.rs index 5272d4249..e4dc95335 100644 --- a/crates/egui/src/widgets/color_picker.rs +++ b/crates/egui/src/widgets/color_picker.rs @@ -114,7 +114,7 @@ fn color_button(ui: &mut Ui, color: Color32, open: bool) -> Response { } fn color_slider_1d(ui: &mut Ui, value: &mut f32, color_at: impl Fn(f32) -> Color32) -> Response { - #![allow(clippy::identity_op)] + #![expect(clippy::identity_op)] let desired_size = vec2(ui.spacing().slider_width, ui.spacing().interact_size.y); let (rect, response) = ui.allocate_at_least(desired_size, Sense::click_and_drag()); diff --git a/crates/egui/src/widgets/drag_value.rs b/crates/egui/src/widgets/drag_value.rs index 880c71a21..7841fee61 100644 --- a/crates/egui/src/widgets/drag_value.rs +++ b/crates/egui/src/widgets/drag_value.rs @@ -1,4 +1,4 @@ -#![allow(clippy::needless_pass_by_value)] // False positives with `impl ToString` +#![expect(clippy::needless_pass_by_value)] // False positives with `impl ToString` use std::{cmp::Ordering, ops::RangeInclusive}; diff --git a/crates/egui/src/widgets/slider.rs b/crates/egui/src/widgets/slider.rs index a0b9145ac..69d08c44e 100644 --- a/crates/egui/src/widgets/slider.rs +++ b/crates/egui/src/widgets/slider.rs @@ -1,4 +1,4 @@ -#![allow(clippy::needless_pass_by_value)] // False positives with `impl ToString` +#![expect(clippy::needless_pass_by_value)] // False positives with `impl ToString` use std::ops::RangeInclusive; diff --git a/crates/egui_demo_app/src/apps/custom3d_glow.rs b/crates/egui_demo_app/src/apps/custom3d_glow.rs index 30380e31f..c218ca0ba 100644 --- a/crates/egui_demo_app/src/apps/custom3d_glow.rs +++ b/crates/egui_demo_app/src/apps/custom3d_glow.rs @@ -1,4 +1,4 @@ -#![allow(clippy::undocumented_unsafe_blocks)] +#![expect(clippy::undocumented_unsafe_blocks)] use std::sync::Arc; diff --git a/crates/egui_demo_app/src/main.rs b/crates/egui_demo_app/src/main.rs index 37a235e89..a4ffdb5f9 100644 --- a/crates/egui_demo_app/src/main.rs +++ b/crates/egui_demo_app/src/main.rs @@ -1,8 +1,8 @@ //! Demo app for egui #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release -#![allow(rustdoc::missing_crate_level_docs)] // it's an example -#![allow(clippy::never_loop)] // False positive +#![expect(rustdoc::missing_crate_level_docs)] // it's an example +#![allow(clippy::allow_attributes, clippy::never_loop)] #[global_allocator] static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; // Much faster allocator, can give 20% speedups: https://github.com/emilk/egui/pull/7029 diff --git a/crates/egui_demo_app/src/web.rs b/crates/egui_demo_app/src/web.rs index 2dc3f4770..30940d42f 100644 --- a/crates/egui_demo_app/src/web.rs +++ b/crates/egui_demo_app/src/web.rs @@ -1,5 +1,3 @@ -#![allow(clippy::mem_forget)] // False positives from #[wasm_bindgen] macro - use eframe::wasm_bindgen::{self, prelude::*}; use crate::WrapApp; @@ -14,7 +12,7 @@ pub struct WebHandle { #[wasm_bindgen] impl WebHandle { /// Installs a panic hook, then returns. - #[allow(clippy::new_without_default, clippy::allow_attributes)] + #[allow(clippy::allow_attributes, clippy::new_without_default)] #[wasm_bindgen(constructor)] pub fn new() -> Self { // Redirect [`log`] message to `console.log` and friends: diff --git a/crates/egui_demo_app/src/wrap_app.rs b/crates/egui_demo_app/src/wrap_app.rs index 089127cbd..5dcc89a3e 100644 --- a/crates/egui_demo_app/src/wrap_app.rs +++ b/crates/egui_demo_app/src/wrap_app.rs @@ -183,7 +183,7 @@ impl WrapApp { cc.egui_ctx .add_plugin(crate::accessibility_inspector::AccessibilityInspectorPlugin::default()); - #[allow(unused_mut, clippy::allow_attributes)] + #[allow(clippy::allow_attributes, unused_mut)] let mut slf = Self { state: State::default(), diff --git a/crates/egui_demo_lib/src/demo/widget_gallery.rs b/crates/egui_demo_lib/src/demo/widget_gallery.rs index 96833c25a..fe783af1c 100644 --- a/crates/egui_demo_lib/src/demo/widget_gallery.rs +++ b/crates/egui_demo_lib/src/demo/widget_gallery.rs @@ -48,7 +48,7 @@ impl Default for WidgetGallery { } impl WidgetGallery { - #[allow(unused_mut, clippy::allow_attributes)] // if not chrono + #[allow(clippy::allow_attributes, unused_mut)] // if not chrono #[inline] pub fn with_date_button(mut self, _with_date_button: bool) -> Self { #[cfg(feature = "chrono")] diff --git a/crates/egui_extras/src/lib.rs b/crates/egui_extras/src/lib.rs index 16354c440..19e0c95a8 100644 --- a/crates/egui_extras/src/lib.rs +++ b/crates/egui_extras/src/lib.rs @@ -6,8 +6,7 @@ #![cfg_attr(feature = "document-features", doc = document_features::document_features!())] //! -#![allow(clippy::float_cmp)] -#![allow(clippy::manual_range_contains)] +#![expect(clippy::manual_range_contains)] #[cfg(feature = "chrono")] mod datepicker; diff --git a/crates/egui_extras/src/loaders/svg_loader.rs b/crates/egui_extras/src/loaders/svg_loader.rs index 4b778ff9e..a9c0aa2b0 100644 --- a/crates/egui_extras/src/loaders/svg_loader.rs +++ b/crates/egui_extras/src/loaders/svg_loader.rs @@ -36,7 +36,7 @@ fn is_supported(uri: &str) -> bool { impl Default for SvgLoader { fn default() -> Self { // opt is mutated when `svg_text` feature flag is enabled - #[allow(unused_mut, clippy::allow_attributes)] + #[allow(clippy::allow_attributes, unused_mut)] let mut options = resvg::usvg::Options::default(); #[cfg(feature = "svg_text")] diff --git a/crates/egui_extras/src/syntax_highlighting.rs b/crates/egui_extras/src/syntax_highlighting.rs index 30787d208..0b9a791ea 100644 --- a/crates/egui_extras/src/syntax_highlighting.rs +++ b/crates/egui_extras/src/syntax_highlighting.rs @@ -3,8 +3,6 @@ //! Turn on the `syntect` feature for great syntax highlighting of any language. //! Otherwise, a very simple fallback will be used, that works okish for C, C++, Rust, and Python. -#![allow(clippy::mem_forget)] // False positive from enum_map macro - use egui::TextStyle; use egui::text::LayoutJob; @@ -272,7 +270,7 @@ impl CodeTheme { /// /// There is one dark and one light theme stored at any one time. pub fn from_memory(ctx: &egui::Context, style: &egui::Style) -> Self { - #![allow(clippy::needless_return)] + #![expect(clippy::needless_return)] let (id, default) = if style.visuals.dark_mode { (egui::Id::new("dark"), Self::dark as fn(f32) -> Self) @@ -361,6 +359,7 @@ impl CodeTheme { // function, but at the cost of more code duplication. #[expect(clippy::needless_pass_by_value)] fn dark_with_font_id(font_id: egui::FontId) -> Self { + #![expect(clippy::mem_forget)] use egui::{Color32, TextFormat}; Self { dark_mode: true, @@ -378,6 +377,7 @@ impl CodeTheme { // The syntect version takes it by value #[expect(clippy::needless_pass_by_value)] fn light_with_font_id(font_id: egui::FontId) -> Self { + #![expect(clippy::mem_forget)] use egui::{Color32, TextFormat}; Self { dark_mode: false, diff --git a/crates/egui_extras/src/table.rs b/crates/egui_extras/src/table.rs index 25e838735..78c6e7435 100644 --- a/crates/egui_extras/src/table.rs +++ b/crates/egui_extras/src/table.rs @@ -656,7 +656,7 @@ impl TableState { } fn store(self, ui: &egui::Ui, state_id: egui::Id) { - #![allow(clippy::needless_return)] + #![expect(clippy::needless_return)] #[cfg(feature = "serde")] { return ui.data_mut(|d| d.insert_persisted(state_id, self)); diff --git a/crates/egui_glow/src/lib.rs b/crates/egui_glow/src/lib.rs index 0b815417f..b0ee4c2a2 100644 --- a/crates/egui_glow/src/lib.rs +++ b/crates/egui_glow/src/lib.rs @@ -8,9 +8,7 @@ #![cfg_attr(feature = "document-features", doc = document_features::document_features!())] //! -#![allow(clippy::float_cmp)] -#![allow(clippy::manual_range_contains)] -#![allow(clippy::undocumented_unsafe_blocks)] +#![expect(clippy::undocumented_unsafe_blocks)] pub mod painter; pub use glow; diff --git a/crates/egui_glow/src/misc_util.rs b/crates/egui_glow/src/misc_util.rs index c0c440d78..4b154cea7 100644 --- a/crates/egui_glow/src/misc_util.rs +++ b/crates/egui_glow/src/misc_util.rs @@ -1,4 +1,4 @@ -#![allow(unsafe_code)] +#![expect(unsafe_code)] use glow::HasContext as _; diff --git a/crates/egui_glow/src/painter.rs b/crates/egui_glow/src/painter.rs index 9ec91fc21..97588ede8 100644 --- a/crates/egui_glow/src/painter.rs +++ b/crates/egui_glow/src/painter.rs @@ -1,6 +1,5 @@ -#![allow(clippy::collapsible_else_if)] -#![allow(clippy::unwrap_used)] -#![allow(unsafe_code)] +#![expect(clippy::unwrap_used)] +#![expect(unsafe_code)] use std::{collections::HashMap, sync::Arc}; diff --git a/crates/emath/src/lib.rs b/crates/emath/src/lib.rs index 844f2da59..92e34620a 100644 --- a/crates/emath/src/lib.rs +++ b/crates/emath/src/lib.rs @@ -19,7 +19,7 @@ #![cfg_attr(feature = "document-features", doc = document_features::document_features!())] //! -#![allow(clippy::float_cmp)] +#![expect(clippy::float_cmp)] use std::ops::{Add, Div, Mul, RangeInclusive, Sub}; diff --git a/crates/emath/src/numeric.rs b/crates/emath/src/numeric.rs index 1fbddbc66..b4b6174e2 100644 --- a/crates/emath/src/numeric.rs +++ b/crates/emath/src/numeric.rs @@ -23,7 +23,7 @@ macro_rules! impl_numeric_float { #[inline(always)] fn to_f64(self) -> f64 { - #[allow(trivial_numeric_casts, clippy::allow_attributes)] + #[allow(clippy::allow_attributes, trivial_numeric_casts)] { self as f64 } @@ -31,7 +31,7 @@ macro_rules! impl_numeric_float { #[inline(always)] fn from_f64(num: f64) -> Self { - #[allow(trivial_numeric_casts, clippy::allow_attributes)] + #[allow(clippy::allow_attributes, trivial_numeric_casts)] { num as Self } diff --git a/crates/epaint/src/lib.rs b/crates/epaint/src/lib.rs index 942ca5452..0042e0964 100644 --- a/crates/epaint/src/lib.rs +++ b/crates/epaint/src/lib.rs @@ -20,8 +20,8 @@ #![cfg_attr(feature = "document-features", doc = document_features::document_features!())] //! -#![allow(clippy::float_cmp)] -#![allow(clippy::manual_range_contains)] +#![expect(clippy::float_cmp)] +#![expect(clippy::manual_range_contains)] mod brush; pub mod color; diff --git a/crates/epaint/src/margin.rs b/crates/epaint/src/margin.rs index e6f6d2287..0e2063efe 100644 --- a/crates/epaint/src/margin.rs +++ b/crates/epaint/src/margin.rs @@ -186,7 +186,7 @@ impl std::ops::Div for Margin { #[inline] fn div(self, v: f32) -> Self { - #![allow(clippy::suspicious_arithmetic_impl)] + #![expect(clippy::suspicious_arithmetic_impl)] self * v.recip() } } diff --git a/crates/epaint/src/mesh.rs b/crates/epaint/src/mesh.rs index 2e4fa1dc4..5343fdace 100644 --- a/crates/epaint/src/mesh.rs +++ b/crates/epaint/src/mesh.rs @@ -189,7 +189,7 @@ impl Mesh { /// Rectangle with a texture and color. #[inline(always)] pub fn add_rect_with_uv(&mut self, rect: Rect, uv: Rect, color: Color32) { - #![allow(clippy::identity_op)] + #![expect(clippy::identity_op)] let idx = self.vertices.len() as u32; self.indices .extend_from_slice(&[idx + 0, idx + 1, idx + 2, idx + 2, idx + 1, idx + 3]); diff --git a/crates/epaint/src/mutex.rs b/crates/epaint/src/mutex.rs index 2f264f58c..272046823 100644 --- a/crates/epaint/src/mutex.rs +++ b/crates/epaint/src/mutex.rs @@ -125,7 +125,7 @@ where #[cfg(test)] mod tests { - #![allow(clippy::disallowed_methods)] // Ok for tests + #![expect(clippy::disallowed_methods)] // Ok for tests use crate::mutex::Mutex; use std::time::Duration; @@ -158,7 +158,7 @@ mod tests { #[cfg(not(target_arch = "wasm32"))] #[cfg(test)] mod tests_rwlock { - #![allow(clippy::disallowed_methods)] // Ok for tests + #![expect(clippy::disallowed_methods)] // Ok for tests use crate::mutex::RwLock; use std::time::Duration; diff --git a/crates/epaint/src/shape_transform.rs b/crates/epaint/src/shape_transform.rs index eec526c03..8fce01f64 100644 --- a/crates/epaint/src/shape_transform.rs +++ b/crates/epaint/src/shape_transform.rs @@ -10,7 +10,7 @@ pub fn adjust_colors( shape: &mut Shape, adjust_color: impl Fn(&mut Color32) + Send + Sync + Copy + 'static, ) { - #![allow(clippy::match_same_arms)] + #![expect(clippy::match_same_arms)] match shape { Shape::Noop => {} diff --git a/crates/epaint/src/shapes/bezier_shape.rs b/crates/epaint/src/shapes/bezier_shape.rs index 002612dbb..b20c56691 100644 --- a/crates/epaint/src/shapes/bezier_shape.rs +++ b/crates/epaint/src/shapes/bezier_shape.rs @@ -1,5 +1,4 @@ -#![allow(clippy::many_single_char_names)] -#![allow(clippy::wrong_self_convention)] // False positives +#![expect(clippy::many_single_char_names)] use std::ops::Range; diff --git a/crates/epaint/src/stroke.rs b/crates/epaint/src/stroke.rs index 473376f40..4adb1f309 100644 --- a/crates/epaint/src/stroke.rs +++ b/crates/epaint/src/stroke.rs @@ -1,5 +1,3 @@ -#![allow(clippy::derived_hash_with_manual_eq)] // We need to impl Hash for f32, but we don't implement Eq, which is fine - use std::{fmt::Debug, sync::Arc}; use emath::GuiRounding as _; diff --git a/crates/epaint/src/tessellator.rs b/crates/epaint/src/tessellator.rs index 3f69b0eda..9529765ac 100644 --- a/crates/epaint/src/tessellator.rs +++ b/crates/epaint/src/tessellator.rs @@ -3,7 +3,7 @@ //! This module converts lines, circles, text and more represented by [`Shape`] //! into textured triangles represented by [`Mesh`]. -#![allow(clippy::identity_op)] +#![expect(clippy::identity_op)] use emath::{GuiRounding as _, NumExt as _, Pos2, Rect, Rot2, Vec2, pos2, remap, vec2}; @@ -2207,7 +2207,7 @@ impl Tessellator { /// /// ## Returns /// A list of clip rectangles with matching [`Mesh`]. - #[allow(unused_mut, clippy::allow_attributes)] + #[allow(clippy::allow_attributes, unused_mut)] pub fn tessellate_shapes(&mut self, mut shapes: Vec) -> Vec { profiling::function_scope!(); diff --git a/crates/epaint/src/text/font.rs b/crates/epaint/src/text/font.rs index bce98d924..80fb1245b 100644 --- a/crates/epaint/src/text/font.rs +++ b/crates/epaint/src/text/font.rs @@ -1,4 +1,4 @@ -#![allow(clippy::mem_forget)] +#![expect(clippy::mem_forget)] use emath::{GuiRounding as _, OrderedFloat, Vec2, vec2}; use self_cell::self_cell; diff --git a/crates/epaint/src/text/text_layout_types.rs b/crates/epaint/src/text/text_layout_types.rs index 0928813b8..3e8a53d9e 100644 --- a/crates/epaint/src/text/text_layout_types.rs +++ b/crates/epaint/src/text/text_layout_types.rs @@ -1,6 +1,3 @@ -#![allow(clippy::derived_hash_with_manual_eq)] // We need to impl Hash for f32, but we don't implement Eq, which is fine -#![allow(clippy::wrong_self_convention)] // We use `from_` to indicate conversion direction. It's non-diomatic, but makes sense in this context. - use std::ops::Range; use std::sync::Arc; diff --git a/examples/confirm_exit/src/main.rs b/examples/confirm_exit/src/main.rs index c04a9e378..6c26bed96 100644 --- a/examples/confirm_exit/src/main.rs +++ b/examples/confirm_exit/src/main.rs @@ -1,5 +1,5 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release -#![allow(rustdoc::missing_crate_level_docs)] // it's an example +#![expect(rustdoc::missing_crate_level_docs)] // it's an example use eframe::egui; diff --git a/examples/custom_3d_glow/src/main.rs b/examples/custom_3d_glow/src/main.rs index e8e5c9aeb..6b804ed1c 100644 --- a/examples/custom_3d_glow/src/main.rs +++ b/examples/custom_3d_glow/src/main.rs @@ -1,7 +1,7 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release -#![allow(rustdoc::missing_crate_level_docs)] // it's an example -#![allow(unsafe_code)] -#![allow(clippy::undocumented_unsafe_blocks)] +#![expect(rustdoc::missing_crate_level_docs)] // it's an example +#![expect(unsafe_code)] +#![expect(clippy::undocumented_unsafe_blocks)] use eframe::{egui, egui_glow, glow}; diff --git a/examples/custom_font/src/main.rs b/examples/custom_font/src/main.rs index 91e235b44..851a4fb92 100644 --- a/examples/custom_font/src/main.rs +++ b/examples/custom_font/src/main.rs @@ -1,5 +1,5 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release -#![allow(rustdoc::missing_crate_level_docs)] // it's an example +#![expect(rustdoc::missing_crate_level_docs)] // it's an example use eframe::{ egui, diff --git a/examples/custom_font_style/src/main.rs b/examples/custom_font_style/src/main.rs index 97df9e8c0..742bf4036 100644 --- a/examples/custom_font_style/src/main.rs +++ b/examples/custom_font_style/src/main.rs @@ -1,5 +1,5 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release -#![allow(rustdoc::missing_crate_level_docs)] // it's an example +#![expect(rustdoc::missing_crate_level_docs)] // it's an example use eframe::egui; use egui::{FontFamily, FontId, RichText, TextStyle}; diff --git a/examples/custom_keypad/src/main.rs b/examples/custom_keypad/src/main.rs index 2035aa02c..67e3126aa 100644 --- a/examples/custom_keypad/src/main.rs +++ b/examples/custom_keypad/src/main.rs @@ -1,5 +1,5 @@ // #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release -#![allow(rustdoc::missing_crate_level_docs)] // it's an example +#![expect(rustdoc::missing_crate_level_docs)] // it's an example use eframe::egui; mod keypad; diff --git a/examples/custom_style/src/main.rs b/examples/custom_style/src/main.rs index 381b8a1c8..b8e1599de 100644 --- a/examples/custom_style/src/main.rs +++ b/examples/custom_style/src/main.rs @@ -1,5 +1,5 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release -#![allow(rustdoc::missing_crate_level_docs)] // it's an example +#![expect(rustdoc::missing_crate_level_docs)] // it's an example use eframe::egui::{ self, Color32, Stroke, Style, Theme, global_theme_preference_buttons, style::Selection, diff --git a/examples/external_eventloop_async/src/main.rs b/examples/external_eventloop_async/src/main.rs index f77dea941..9827c96b6 100644 --- a/examples/external_eventloop_async/src/main.rs +++ b/examples/external_eventloop_async/src/main.rs @@ -1,4 +1,4 @@ -#![allow(rustdoc::missing_crate_level_docs)] // it's an example +#![expect(rustdoc::missing_crate_level_docs)] // it's an example #[cfg(target_os = "linux")] mod app; diff --git a/examples/file_dialog/src/main.rs b/examples/file_dialog/src/main.rs index ee544b5bc..63e7bb0a8 100644 --- a/examples/file_dialog/src/main.rs +++ b/examples/file_dialog/src/main.rs @@ -1,5 +1,5 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release -#![allow(rustdoc::missing_crate_level_docs)] // it's an example +#![expect(rustdoc::missing_crate_level_docs)] // it's an example use eframe::egui; diff --git a/examples/hello_world/src/main.rs b/examples/hello_world/src/main.rs index 10fa9bff4..55f4d7821 100644 --- a/examples/hello_world/src/main.rs +++ b/examples/hello_world/src/main.rs @@ -1,5 +1,5 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release -#![allow(rustdoc::missing_crate_level_docs)] // it's an example +#![expect(rustdoc::missing_crate_level_docs)] // it's an example use eframe::egui; diff --git a/examples/hello_world_simple/src/main.rs b/examples/hello_world_simple/src/main.rs index 57b237dc5..cbdfcf1f1 100644 --- a/examples/hello_world_simple/src/main.rs +++ b/examples/hello_world_simple/src/main.rs @@ -1,5 +1,5 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release -#![allow(rustdoc::missing_crate_level_docs)] // it's an example +#![expect(rustdoc::missing_crate_level_docs)] // it's an example use eframe::egui; diff --git a/examples/images/src/main.rs b/examples/images/src/main.rs index 9d40baae6..8259ccdc7 100644 --- a/examples/images/src/main.rs +++ b/examples/images/src/main.rs @@ -1,5 +1,5 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release -#![allow(rustdoc::missing_crate_level_docs)] // it's an example +#![expect(rustdoc::missing_crate_level_docs)] // it's an example use eframe::egui; diff --git a/examples/keyboard_events/src/main.rs b/examples/keyboard_events/src/main.rs index 29940588d..a008ac20d 100644 --- a/examples/keyboard_events/src/main.rs +++ b/examples/keyboard_events/src/main.rs @@ -1,5 +1,5 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release -#![allow(rustdoc::missing_crate_level_docs)] // it's an example +#![expect(rustdoc::missing_crate_level_docs)] // it's an example use eframe::egui; use egui::{Key, ScrollArea}; diff --git a/examples/multiple_viewports/src/main.rs b/examples/multiple_viewports/src/main.rs index e812bfb70..253e81b0e 100644 --- a/examples/multiple_viewports/src/main.rs +++ b/examples/multiple_viewports/src/main.rs @@ -1,5 +1,5 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release -#![allow(rustdoc::missing_crate_level_docs)] // it's an example +#![expect(rustdoc::missing_crate_level_docs)] // it's an example use std::sync::{ Arc, diff --git a/examples/popups/src/main.rs b/examples/popups/src/main.rs index b7c91e729..16e0cf049 100644 --- a/examples/popups/src/main.rs +++ b/examples/popups/src/main.rs @@ -1,5 +1,5 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release -#![allow(rustdoc::missing_crate_level_docs)] // it's an example +#![expect(rustdoc::missing_crate_level_docs)] // it's an example use eframe::egui::{CentralPanel, ComboBox, Popup, PopupCloseBehavior}; diff --git a/examples/puffin_profiler/src/main.rs b/examples/puffin_profiler/src/main.rs index 14e362226..3b7ebddb1 100644 --- a/examples/puffin_profiler/src/main.rs +++ b/examples/puffin_profiler/src/main.rs @@ -1,5 +1,5 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release -#![allow(rustdoc::missing_crate_level_docs)] // it's an example +#![expect(rustdoc::missing_crate_level_docs)] // it's an example use std::sync::{ Arc, diff --git a/examples/serial_windows/src/main.rs b/examples/serial_windows/src/main.rs index 0873d2ada..9959f9b01 100644 --- a/examples/serial_windows/src/main.rs +++ b/examples/serial_windows/src/main.rs @@ -1,5 +1,5 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release -#![allow(rustdoc::missing_crate_level_docs)] // it's an example +#![expect(rustdoc::missing_crate_level_docs)] // it's an example use eframe::egui; diff --git a/examples/user_attention/src/main.rs b/examples/user_attention/src/main.rs index b657c75d9..c26dd903c 100644 --- a/examples/user_attention/src/main.rs +++ b/examples/user_attention/src/main.rs @@ -1,5 +1,5 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release -#![allow(rustdoc::missing_crate_level_docs)] // it's an example +#![expect(rustdoc::missing_crate_level_docs)] // it's an example use eframe::{CreationContext, NativeOptions, egui}; use egui::{Button, CentralPanel, UserAttentionType}; diff --git a/tests/test_size_pass/src/main.rs b/tests/test_size_pass/src/main.rs index 9822701cb..814def92b 100644 --- a/tests/test_size_pass/src/main.rs +++ b/tests/test_size_pass/src/main.rs @@ -1,5 +1,5 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release -#![allow(rustdoc::missing_crate_level_docs)] // it's a test +#![expect(rustdoc::missing_crate_level_docs)] // it's a test use eframe::egui; diff --git a/tests/test_ui_stack/src/main.rs b/tests/test_ui_stack/src/main.rs index 53f42727b..a2ce967b8 100644 --- a/tests/test_ui_stack/src/main.rs +++ b/tests/test_ui_stack/src/main.rs @@ -1,5 +1,5 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release -#![allow(rustdoc::missing_crate_level_docs)] // it's an example +#![expect(rustdoc::missing_crate_level_docs)] // it's an example use std::sync::Arc; diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 0f16c5454..81471d622 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -1,7 +1,6 @@ //! Helper crate for running scripts within the `egui` repo -#![allow(clippy::print_stdout)] -#![allow(clippy::print_stderr)] +#![expect(clippy::print_stderr, clippy::print_stdout)] #![allow(clippy::exit)] mod deny;