From 62a907ba89fa395a051330d52d60835679c6b74c Mon Sep 17 00:00:00 2001 From: Nicolas Date: Sun, 22 Sep 2024 22:05:32 +0200 Subject: [PATCH] start poc to rust version `1.81.0` --- .github/workflows/deploy_web_demo.yml | 3 +- .github/workflows/rust.yml | 12 +++---- Cargo.lock | 16 +++++++--- Cargo.toml | 11 ++++--- clippy.toml | 2 +- crates/ecolor/src/hex_color_macro.rs | 2 +- crates/eframe/src/epi.rs | 9 +++--- .../eframe/src/native/event_loop_context.rs | 2 +- crates/eframe/src/native/run.rs | 2 +- crates/eframe/src/native/wgpu_integration.rs | 2 +- crates/eframe/src/web/app_runner.rs | 2 +- crates/eframe/src/web/web_painter_wgpu.rs | 1 + crates/eframe/src/web/web_runner.rs | 2 +- crates/egui-wgpu/src/renderer.rs | 2 +- crates/egui-wgpu/src/winit.rs | 2 +- crates/egui/src/containers/resize.rs | 4 +-- crates/egui/src/containers/scroll_area.rs | 2 +- crates/egui/src/grid.rs | 4 +-- crates/egui/src/input_state/mod.rs | 6 ++-- crates/egui/src/layout.rs | 29 +++++++++-------- crates/egui/src/lib.rs | 2 +- crates/egui/src/memory/mod.rs | 2 +- crates/egui/src/style.rs | 2 +- crates/egui/src/widgets/color_picker.rs | 1 + crates/egui/src/widgets/slider.rs | 10 +++--- crates/egui/src/widgets/text_edit/state.rs | 4 +-- crates/egui_demo_app/src/frame_history.rs | 2 +- crates/egui_demo_lib/src/demo/sliders.rs | 3 +- .../src/easy_mark/easy_mark_parser.rs | 2 +- crates/egui_extras/src/table.rs | 2 +- crates/egui_glow/src/shader_version.rs | 2 +- crates/emath/src/numeric.rs | 8 ++--- crates/emath/src/rect.rs | 9 +++--- crates/emath/src/smart_aim.rs | 31 +++++++++++-------- crates/epaint/src/bezier.rs | 4 +-- crates/epaint/src/text/text_layout_types.rs | 4 +-- crates/epaint/src/texture_handle.rs | 4 +-- examples/confirm_exit/Cargo.toml | 2 +- examples/custom_3d_glow/Cargo.toml | 2 +- examples/custom_font/Cargo.toml | 2 +- examples/custom_font_style/Cargo.toml | 2 +- examples/custom_keypad/Cargo.toml | 2 +- examples/custom_style/Cargo.toml | 2 +- examples/custom_window_frame/Cargo.toml | 2 +- examples/file_dialog/Cargo.toml | 2 +- examples/hello_world/Cargo.toml | 2 +- examples/hello_world_par/Cargo.toml | 6 ++-- examples/hello_world_simple/Cargo.toml | 2 +- examples/images/Cargo.toml | 2 +- examples/keyboard_events/Cargo.toml | 2 +- examples/multiple_viewports/Cargo.toml | 2 +- examples/puffin_profiler/Cargo.toml | 2 +- examples/screenshot/Cargo.toml | 2 +- examples/serial_windows/Cargo.toml | 2 +- examples/user_attention/Cargo.toml | 2 +- rust-toolchain | 2 +- scripts/check.sh | 14 ++++----- scripts/clippy_wasm/clippy.toml | 2 +- tests/test_egui_extras_compilation/Cargo.toml | 2 +- tests/test_inline_glow_paint/Cargo.toml | 2 +- tests/test_size_pass/Cargo.toml | 2 +- tests/test_ui_stack/Cargo.toml | 2 +- tests/test_viewports/Cargo.toml | 2 +- 63 files changed, 142 insertions(+), 133 deletions(-) diff --git a/.github/workflows/deploy_web_demo.yml b/.github/workflows/deploy_web_demo.yml index 717266d6362..db39e3bfa64 100644 --- a/.github/workflows/deploy_web_demo.yml +++ b/.github/workflows/deploy_web_demo.yml @@ -11,7 +11,6 @@ on: # release: # types: ["published"] - permissions: contents: write # for committing to gh-pages branch @@ -39,7 +38,7 @@ jobs: with: profile: minimal target: wasm32-unknown-unknown - toolchain: 1.76.0 + toolchain: 1.81.0 override: true - uses: Swatinem/rust-cache@v2 diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 1e8e31bbcf1..a58c9dd6605 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -16,7 +16,7 @@ jobs: - uses: dtolnay/rust-toolchain@master with: - toolchain: 1.76.0 + toolchain: 1.81.0 - name: Install packages (Linux) if: runner.os == 'Linux' @@ -87,7 +87,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: 1.76.0 + toolchain: 1.81.0 targets: wasm32-unknown-unknown - run: sudo apt-get update && sudo apt-get install libgtk-3-dev libatk1.0-dev @@ -159,7 +159,7 @@ jobs: - uses: actions/checkout@v4 - uses: EmbarkStudios/cargo-deny-action@v1 with: - rust-version: "1.76.0" + rust-version: "1.81.0" log-level: error command: check arguments: --target ${{ matrix.target }} @@ -174,7 +174,7 @@ jobs: - uses: dtolnay/rust-toolchain@master with: - toolchain: 1.76.0 + toolchain: 1.81.0 targets: aarch64-linux-android - name: Set up cargo cache @@ -193,7 +193,7 @@ jobs: - uses: dtolnay/rust-toolchain@master with: - toolchain: 1.76.0 + toolchain: 1.81.0 targets: aarch64-apple-ios - name: Set up cargo cache @@ -212,7 +212,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: 1.76.0 + toolchain: 1.81.0 - name: Set up cargo cache uses: Swatinem/rust-cache@v2 diff --git a/Cargo.lock b/Cargo.lock index 1a2423eaa8a..166b4b48621 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2571,6 +2571,12 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-traits" version = "0.2.16" @@ -3894,12 +3900,13 @@ dependencies = [ [[package]] name = "time" -version = "0.3.30" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", + "num-conv", "powerfmt", "serde", "time-core", @@ -3914,10 +3921,11 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.15" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ + "num-conv", "time-core", ] diff --git a/Cargo.toml b/Cargo.toml index b8e02f3fdbe..3c8d74f70eb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ members = [ [workspace.package] edition = "2021" license = "MIT OR Apache-2.0" -rust-version = "1.76" +rust-version = "1.81" version = "0.28.1" @@ -100,12 +100,13 @@ winit = { version = "0.30.5", default-features = false } unsafe_code = "deny" elided_lifetimes_in_paths = "warn" -future_incompatible = "warn" -nonstandard_style = "warn" -rust_2018_idioms = "warn" +# future_incompatible = "warn" +# nonstandard_style = "warn" +# rust_2018_idioms = "warn" rust_2021_prelude_collisions = "warn" semicolon_in_expressions_from_macros = "warn" trivial_numeric_casts = "warn" +unexpected_cfgs = "warn" unsafe_op_in_unsafe_fn = "warn" # `unsafe_op_in_unsafe_fn` may become the default in future Rust versions: https://github.com/rust-lang/rust/issues/71668 unused_extern_crates = "warn" unused_import_braces = "warn" @@ -191,7 +192,7 @@ match_same_arms = "warn" match_wild_err_arm = "warn" match_wildcard_for_single_variants = "warn" mem_forget = "warn" -mismatched_target_os = "warn" +# mismatched_target_os = "warn" # renamed mismatching_type_param_order = "warn" missing_enforced_import_renames = "warn" missing_errors_doc = "warn" diff --git a/clippy.toml b/clippy.toml index f480ca93d7e..d0c6e21ce92 100644 --- a/clippy.toml +++ b/clippy.toml @@ -3,7 +3,7 @@ # ----------------------------------------------------------------------------- # Section identical to scripts/clippy_wasm/clippy.toml: -msrv = "1.76" +msrv = "1.81" allow-unwrap-in-tests = true diff --git a/crates/ecolor/src/hex_color_macro.rs b/crates/ecolor/src/hex_color_macro.rs index a0a0729fdd1..2c4acca265b 100644 --- a/crates/ecolor/src/hex_color_macro.rs +++ b/crates/ecolor/src/hex_color_macro.rs @@ -17,7 +17,7 @@ macro_rules! hex_color { if array.len() == 3 { $crate::Color32::from_rgb(array[0], array[1], array[2]) } else { - #[allow(unconditional_panic)] + #[allow(unconditional_panic, clippy::out_of_bounds_indexing)] $crate::Color32::from_rgba_unmultiplied(array[0], array[1], array[2], array[3]) } }}; diff --git a/crates/eframe/src/epi.rs b/crates/eframe/src/epi.rs index f567507c4da..208292e321d 100644 --- a/crates/eframe/src/epi.rs +++ b/crates/eframe/src/epi.rs @@ -331,7 +331,7 @@ pub struct NativeOptions { pub window_builder: Option, #[cfg(feature = "glow")] - /// Needed for cross compiling for VirtualBox VMSVGA driver with OpenGL ES 2.0 and OpenGL 2.1 which doesn't support SRGB texture. + /// Needed for cross compiling for `VirtualBox` VMSVGA driver with OpenGL ES 2.0 and OpenGL 2.1 which doesn't support SRGB texture. /// See . /// /// For OpenGL ES 2.0: set this to [`egui_glow::ShaderVersion::Es100`] to solve blank texture problem (by using the "fallback shader"). @@ -439,7 +439,7 @@ pub struct WebOptions { /// Unused by webgl context as of writing. pub depth_buffer: u8, - /// Which version of WebGl context to select + /// Which version of `WebGl` context to select /// /// Default: [`WebGlContextOption::BestFirst`]. #[cfg(feature = "glow")] @@ -492,7 +492,7 @@ impl Default for WebOptions { #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] pub enum WebGlContextOption { - /// Force Use WebGL1. + /// Force Use `WebGL1`. WebGl1, /// Force use WebGL2. @@ -501,7 +501,7 @@ pub enum WebGlContextOption { /// Use WebGL2 first. BestFirst, - /// Use WebGL1 first + /// Use `WebGL1` first CompatibilityFirst, } @@ -799,6 +799,7 @@ pub trait Storage { } /// Stores nothing. +#[allow(dead_code)] #[derive(Clone, Default)] pub(crate) struct DummyStorage {} diff --git a/crates/eframe/src/native/event_loop_context.rs b/crates/eframe/src/native/event_loop_context.rs index 2bb9e42555a..8f54681a869 100644 --- a/crates/eframe/src/native/event_loop_context.rs +++ b/crates/eframe/src/native/event_loop_context.rs @@ -2,7 +2,7 @@ use std::cell::Cell; use winit::event_loop::ActiveEventLoop; thread_local! { - static CURRENT_EVENT_LOOP: Cell> = Cell::new(None); + static CURRENT_EVENT_LOOP: Cell> = const { Cell::new(None) }; } struct EventLoopGuard; diff --git a/crates/eframe/src/native/run.rs b/crates/eframe/src/native/run.rs index 7964a1e9ad4..43dd07ee0da 100644 --- a/crates/eframe/src/native/run.rs +++ b/crates/eframe/src/native/run.rs @@ -37,7 +37,7 @@ fn with_event_loop( mut native_options: epi::NativeOptions, f: impl FnOnce(&mut EventLoop, epi::NativeOptions) -> R, ) -> Result { - thread_local!(static EVENT_LOOP: std::cell::RefCell>> = std::cell::RefCell::new(None)); + thread_local!(static EVENT_LOOP: std::cell::RefCell>> = const { std::cell::RefCell::new(None) }); EVENT_LOOP.with(|event_loop| { // Since we want to reference NativeOptions when creating the EventLoop we can't diff --git a/crates/eframe/src/native/wgpu_integration.rs b/crates/eframe/src/native/wgpu_integration.rs index 997383f85c3..9936dc927fa 100644 --- a/crates/eframe/src/native/wgpu_integration.rs +++ b/crates/eframe/src/native/wgpu_integration.rs @@ -491,7 +491,7 @@ impl<'app> WgpuWinitRunning<'app> { fn save_and_destroy(&mut self) { crate::profile_function!(); - let mut shared = self.shared.borrow_mut(); + let shared = self.shared.borrow_mut(); if let Some(Viewport { window, .. }) = shared.viewports.get(&ViewportId::ROOT) { self.integration.save(self.app.as_mut(), window.as_deref()); } diff --git a/crates/eframe/src/web/app_runner.rs b/crates/eframe/src/web/app_runner.rs index 00cc8f0c182..2f8f78d0818 100644 --- a/crates/eframe/src/web/app_runner.rs +++ b/crates/eframe/src/web/app_runner.rs @@ -260,7 +260,7 @@ impl AppRunner { self.frame.info.cpu_usage = Some(cpu_usage_seconds); } - fn handle_platform_output(&mut self, platform_output: egui::PlatformOutput) { + fn handle_platform_output(&self, platform_output: egui::PlatformOutput) { #[cfg(feature = "web_screen_reader")] if self.egui_ctx.options(|o| o.screen_reader) { super::screen_reader::speak(&platform_output.events_description()); diff --git a/crates/eframe/src/web/web_painter_wgpu.rs b/crates/eframe/src/web/web_painter_wgpu.rs index 7d845a969e5..c16cb5c43e7 100644 --- a/crates/eframe/src/web/web_painter_wgpu.rs +++ b/crates/eframe/src/web/web_painter_wgpu.rs @@ -13,6 +13,7 @@ use crate::WebOptions; use super::web_painter::WebPainter; +#[allow(dead_code)] // is not used in wasm struct EguiWebWindow(u32); #[allow(unsafe_code)] diff --git a/crates/eframe/src/web/web_runner.rs b/crates/eframe/src/web/web_runner.rs index a2793a13aeb..96c74cc0b59 100644 --- a/crates/eframe/src/web/web_runner.rs +++ b/crates/eframe/src/web/web_runner.rs @@ -16,7 +16,7 @@ pub struct WebRunner { /// Have we ever panicked? panic_handler: PanicHandler, - /// If we ever panic during running, this RefCell is poisoned. + /// If we ever panic during running, this `RefCell` is poisoned. /// So before we use it, we need to check [`Self::panic_handler`]. runner: Rc>>, diff --git a/crates/egui-wgpu/src/renderer.rs b/crates/egui-wgpu/src/renderer.rs index eda934944ea..bc4285d3b5c 100644 --- a/crates/egui-wgpu/src/renderer.rs +++ b/crates/egui-wgpu/src/renderer.rs @@ -125,7 +125,7 @@ pub struct ScreenDescriptor { /// Size of the window in physical pixels. pub size_in_pixels: [u32; 2], - /// HiDPI scale factor (pixels per point). + /// `HiDPI` scale factor (pixels per point). pub pixels_per_point: f32, } diff --git a/crates/egui-wgpu/src/winit.rs b/crates/egui-wgpu/src/winit.rs index 46db8821e02..5ed8635347f 100644 --- a/crates/egui-wgpu/src/winit.rs +++ b/crates/egui-wgpu/src/winit.rs @@ -714,7 +714,7 @@ impl Painter { } #[allow(clippy::unused_self)] - pub fn destroy(&mut self) { + pub fn destroy(&self) { // TODO(emilk): something here? } } diff --git a/crates/egui/src/containers/resize.rs b/crates/egui/src/containers/resize.rs index 458bf11229d..84f687783aa 100644 --- a/crates/egui/src/containers/resize.rs +++ b/crates/egui/src/containers/resize.rs @@ -205,7 +205,7 @@ struct Prepared { } impl Resize { - fn begin(&mut self, ui: &mut Ui) -> Prepared { + fn begin(&self, ui: &mut Ui) -> Prepared { let position = ui.available_rect_before_wrap().min; let id = self.id.unwrap_or_else(|| { let id_salt = self.id_salt.unwrap_or_else(|| Id::new("resize")); @@ -295,7 +295,7 @@ impl Resize { } } - pub fn show(mut self, ui: &mut Ui, add_contents: impl FnOnce(&mut Ui) -> R) -> R { + pub fn show(self, ui: &mut Ui, add_contents: impl FnOnce(&mut Ui) -> R) -> R { let mut prepared = self.begin(ui); let ret = add_contents(&mut prepared.content_ui); self.end(ui, prepared); diff --git a/crates/egui/src/containers/scroll_area.rs b/crates/egui/src/containers/scroll_area.rs index ab7da8aff29..4fbd22f5dcc 100644 --- a/crates/egui/src/containers/scroll_area.rs +++ b/crates/egui/src/containers/scroll_area.rs @@ -39,7 +39,7 @@ pub struct State { scroll_start_offset_from_top_left: [Option; 2], /// Is the scroll sticky. This is true while scroll handle is in the end position - /// and remains that way until the user moves the scroll_handle. Once unstuck (false) + /// and remains that way until the user moves the `scroll_handle`. Once unstuck (false) /// it remains false until the scroll touches the end position, which reenables stickiness. scroll_stuck_to_end: Vec2b, diff --git a/crates/egui/src/grid.rs b/crates/egui/src/grid.rs index 3c4986fcad0..0342f6f5227 100644 --- a/crates/egui/src/grid.rs +++ b/crates/egui/src/grid.rs @@ -227,7 +227,7 @@ impl GridLayout { self.col += 1; } - fn paint_row(&mut self, cursor: &Rect, painter: &Painter) { + fn paint_row(&self, cursor: &Rect, painter: &Painter) { // handle row color painting based on color-picker function let Some(color_picker) = self.color_picker.as_ref() else { return; @@ -450,7 +450,7 @@ impl Grid { ui.allocate_new_ui(ui_builder, |ui| { ui.horizontal(|ui| { let is_color = color_picker.is_some(); - let mut grid = GridLayout { + let grid = GridLayout { num_columns, color_picker, min_cell_size: vec2(min_col_width, min_row_height), diff --git a/crates/egui/src/input_state/mod.rs b/crates/egui/src/input_state/mod.rs index 7f743ee709a..99c166cf443 100644 --- a/crates/egui/src/input_state/mod.rs +++ b/crates/egui/src/input_state/mod.rs @@ -889,9 +889,9 @@ impl Default for PointerState { press_start_time: None, has_moved_too_much_for_a_click: false, started_decidedly_dragging: false, - last_click_time: std::f64::NEG_INFINITY, - last_last_click_time: std::f64::NEG_INFINITY, - last_move_time: std::f64::NEG_INFINITY, + last_click_time: f64::NEG_INFINITY, + last_last_click_time: f64::NEG_INFINITY, + last_move_time: f64::NEG_INFINITY, pointer_events: vec![], input_options: Default::default(), } diff --git a/crates/egui/src/layout.rs b/crates/egui/src/layout.rs index 0293904ec0a..7f10ee96e38 100644 --- a/crates/egui/src/layout.rs +++ b/crates/egui/src/layout.rs @@ -2,7 +2,6 @@ use crate::{ emath::{pos2, vec2, Align2, NumExt, Pos2, Rect, Vec2}, Align, }; -use std::f32::INFINITY; // ---------------------------------------------------------------------------- @@ -402,16 +401,16 @@ impl Layout { match self.main_dir { Direction::LeftToRight => { - cursor.max.x = INFINITY; + cursor.max.x = f32::INFINITY; } Direction::RightToLeft => { - cursor.min.x = -INFINITY; + cursor.min.x = -f32::INFINITY; } Direction::TopDown => { - cursor.max.y = INFINITY; + cursor.max.y = f32::INFINITY; } Direction::BottomUp => { - cursor.min.y = -INFINITY; + cursor.min.y = -f32::INFINITY; } } @@ -538,7 +537,7 @@ impl Layout { let new_top = min_rect.bottom() + spacing.y; // tighter packing cursor = Rect::from_min_max( pos2(max_rect.left(), new_top), - pos2(INFINITY, new_top + new_row_height), + pos2(f32::INFINITY, new_top + new_row_height), ); max_rect.max.y = max_rect.max.y.max(cursor.max.y); } @@ -550,7 +549,7 @@ impl Layout { // let new_top = cursor.bottom() + spacing.y; let new_top = min_rect.bottom() + spacing.y; // tighter packing cursor = Rect::from_min_max( - pos2(-INFINITY, new_top), + pos2(-f32::INFINITY, new_top), pos2(max_rect.right(), new_top + new_row_height), ); max_rect.max.y = max_rect.max.y.max(cursor.max.y); @@ -562,7 +561,7 @@ impl Layout { let new_col_width = cursor.width().max(child_size.x); cursor = Rect::from_min_max( pos2(cursor.right() + spacing.x, max_rect.top()), - pos2(cursor.right() + spacing.x + new_col_width, INFINITY), + pos2(cursor.right() + spacing.x + new_col_width, f32::INFINITY), ); max_rect.max.x = max_rect.max.x.max(cursor.max.x); } @@ -572,7 +571,7 @@ impl Layout { // New column let new_col_width = cursor.width().max(child_size.x); cursor = Rect::from_min_max( - pos2(cursor.right() + spacing.x, -INFINITY), + pos2(cursor.right() + spacing.x, -f32::INFINITY), pos2( cursor.right() + spacing.x + new_col_width, max_rect.bottom(), @@ -713,24 +712,24 @@ impl Layout { Direction::LeftToRight => { *cursor = Rect::from_min_max( pos2(f32::NAN, frame_rect.min.y), - pos2(INFINITY, frame_rect.max.y), + pos2(f32::INFINITY, frame_rect.max.y), ); } Direction::RightToLeft => { *cursor = Rect::from_min_max( - pos2(-INFINITY, frame_rect.min.y), + pos2(-f32::INFINITY, frame_rect.min.y), pos2(f32::NAN, frame_rect.max.y), ); } Direction::TopDown => { *cursor = Rect::from_min_max( pos2(frame_rect.min.x, f32::NAN), - pos2(frame_rect.max.x, INFINITY), + pos2(frame_rect.max.x, f32::INFINITY), ); } Direction::BottomUp => { *cursor = Rect::from_min_max( - pos2(frame_rect.min.x, -INFINITY), + pos2(frame_rect.min.x, -f32::INFINITY), pos2(frame_rect.max.x, f32::NAN), ); } @@ -772,13 +771,13 @@ impl Layout { let new_top = region.cursor.bottom() + spacing.y; region.cursor = Rect::from_min_max( pos2(region.max_rect.left(), new_top), - pos2(INFINITY, new_top + region.cursor.height()), + pos2(f32::INFINITY, new_top + region.cursor.height()), ); } Direction::RightToLeft => { let new_top = region.cursor.bottom() + spacing.y; region.cursor = Rect::from_min_max( - pos2(-INFINITY, new_top), + pos2(-f32::INFINITY, new_top), pos2(region.max_rect.right(), new_top + region.cursor.height()), ); } diff --git a/crates/egui/src/lib.rs b/crates/egui/src/lib.rs index 29cd9ddcac8..206acb7b300 100644 --- a/crates/egui/src/lib.rs +++ b/crates/egui/src/lib.rs @@ -3,7 +3,7 @@ //! Try the live web demo: . Read more about egui at . //! //! `egui` is in heavy development, with each new version having breaking changes. -//! You need to have rust 1.76.0 or later to use `egui`. +//! You need to have rust 1.81.0 or later to use `egui`. //! //! To quickly get started with egui, you can take a look at [`eframe_template`](https://github.com/emilk/eframe_template) //! which uses [`eframe`](https://docs.rs/eframe). diff --git a/crates/egui/src/memory/mod.rs b/crates/egui/src/memory/mod.rs index 8d7476a2d9d..e24a318471c 100644 --- a/crates/egui/src/memory/mod.rs +++ b/crates/egui/src/memory/mod.rs @@ -716,7 +716,7 @@ impl Focus { let current_rect = self.focus_widgets_cache.get(¤t_focused.id)?; - let mut best_score = std::f32::INFINITY; + let mut best_score = f32::INFINITY; let mut best_id = None; for (candidate_id, candidate_rect) in &self.focus_widgets_cache { diff --git a/crates/egui/src/style.rs b/crates/egui/src/style.rs index c460312b678..9cff38293f3 100644 --- a/crates/egui/src/style.rs +++ b/crates/egui/src/style.rs @@ -288,7 +288,7 @@ pub struct Style { /// If true and scrolling is enabled for only one direction, allow horizontal scrolling without pressing shift pub always_scroll_the_only_direction: bool, - /// The animation that should be used when scrolling a [`crate::ScrollArea`] using e.g. [Ui::scroll_to_rect]. + /// The animation that should be used when scrolling a [`crate::ScrollArea`] using e.g. [`Ui::scroll_to_rect`]. pub scroll_animation: ScrollAnimation, } diff --git a/crates/egui/src/widgets/color_picker.rs b/crates/egui/src/widgets/color_picker.rs index a00d6f9ac3b..0d48d68c144 100644 --- a/crates/egui/src/widgets/color_picker.rs +++ b/crates/egui/src/widgets/color_picker.rs @@ -165,6 +165,7 @@ fn color_slider_1d(ui: &mut Ui, value: &mut f32, color_at: impl Fn(f32) -> Color /// * `x_value` - X axis, either saturation or value (0.0-1.0). /// * `y_value` - Y axis, either saturation or value (0.0-1.0). /// * `color_at` - A function that dictates how the mix of saturation and value will be displayed in the 2d slider. +/// /// E.g.: `|x_value, y_value| HsvaGamma { h: 1.0, s: x_value, v: y_value, a: 1.0 }.into()` displays the colors as follows: top-left: white \[s: 0.0, v: 1.0], top-right: fully saturated color \[s: 1.0, v: 1.0], bottom-right: black \[s: 0.0, v: 1.0]. /// fn color_slider_2d( diff --git a/crates/egui/src/widgets/slider.rs b/crates/egui/src/widgets/slider.rs index 7b0cb074ea5..d30f96f115e 100644 --- a/crates/egui/src/widgets/slider.rs +++ b/crates/egui/src/widgets/slider.rs @@ -1030,8 +1030,6 @@ impl<'a> Widget for Slider<'a> { // Logarithmic sliders are allowed to include zero and infinity, // even though mathematically it doesn't make sense. -use std::f64::INFINITY; - /// When the user asks for an infinitely large range (e.g. logarithmic from zero), /// give a scale that this many orders of magnitude in size. const INF_RANGE_MAGNITUDE: f64 = 10.0; @@ -1138,7 +1136,7 @@ fn range_log10(min: f64, max: f64, spec: &SliderSpec) -> (f64, f64) { assert!(spec.logarithmic); assert!(min <= max); - if min == 0.0 && max == INFINITY { + if min == 0.0 && max == f64::INFINITY { (spec.smallest_positive.log10(), INF_RANGE_MAGNITUDE) } else if min == 0.0 { if spec.smallest_positive < max { @@ -1146,7 +1144,7 @@ fn range_log10(min: f64, max: f64, spec: &SliderSpec) -> (f64, f64) { } else { (max.log10() - INF_RANGE_MAGNITUDE, max.log10()) } - } else if max == INFINITY { + } else if max == f64::INFINITY { if min < spec.largest_finite { (min.log10(), spec.largest_finite.log10()) } else { @@ -1162,12 +1160,12 @@ fn range_log10(min: f64, max: f64, spec: &SliderSpec) -> (f64, f64) { fn logarithmic_zero_cutoff(min: f64, max: f64) -> f64 { assert!(min < 0.0 && 0.0 < max); - let min_magnitude = if min == -INFINITY { + let min_magnitude = if min == -f64::INFINITY { INF_RANGE_MAGNITUDE } else { min.abs().log10().abs() }; - let max_magnitude = if max == INFINITY { + let max_magnitude = if max == f64::INFINITY { INF_RANGE_MAGNITUDE } else { max.log10().abs() diff --git a/crates/egui/src/widgets/text_edit/state.rs b/crates/egui/src/widgets/text_edit/state.rs index e73664a1293..5add7409fa3 100644 --- a/crates/egui/src/widgets/text_edit/state.rs +++ b/crates/egui/src/widgets/text_edit/state.rs @@ -89,11 +89,11 @@ impl TextEditState { self.undoer.lock().clone() } - pub fn set_undoer(&mut self, undoer: TextEditUndoer) { + pub fn set_undoer(&self, undoer: TextEditUndoer) { *self.undoer.lock() = undoer; } - pub fn clear_undoer(&mut self) { + pub fn clear_undoer(&self) { self.set_undoer(TextEditUndoer::default()); } diff --git a/crates/egui_demo_app/src/frame_history.rs b/crates/egui_demo_app/src/frame_history.rs index 535d6d9f95f..a6a3fbeeb3f 100644 --- a/crates/egui_demo_app/src/frame_history.rs +++ b/crates/egui_demo_app/src/frame_history.rs @@ -32,7 +32,7 @@ impl FrameHistory { 1.0 / self.frame_times.mean_time_interval().unwrap_or_default() } - pub fn ui(&mut self, ui: &mut egui::Ui) { + pub fn ui(&self, ui: &mut egui::Ui) { ui.label(format!( "Mean CPU usage: {:.2} ms / frame", 1e3 * self.mean_frame_time() diff --git a/crates/egui_demo_lib/src/demo/sliders.rs b/crates/egui_demo_lib/src/demo/sliders.rs index d15d9aa3100..ef8bdb0cd11 100644 --- a/crates/egui_demo_lib/src/demo/sliders.rs +++ b/crates/egui_demo_lib/src/demo/sliders.rs @@ -1,5 +1,4 @@ use egui::{style::HandleShape, Slider, SliderClamping, SliderOrientation, Ui}; -use std::f64::INFINITY; /// Showcase sliders #[derive(PartialEq)] @@ -77,7 +76,7 @@ impl crate::View for Sliders { let (type_min, type_max) = if *integer { ((i32::MIN as f64), (i32::MAX as f64)) } else if *logarithmic { - (-INFINITY, INFINITY) + (-f64::INFINITY, f64::INFINITY) } else { (-1e5, 1e5) // linear sliders make little sense with huge numbers }; diff --git a/crates/egui_demo_lib/src/easy_mark/easy_mark_parser.rs b/crates/egui_demo_lib/src/easy_mark/easy_mark_parser.rs index 75d8135dff5..62aea6df046 100644 --- a/crates/egui_demo_lib/src/easy_mark/easy_mark_parser.rs +++ b/crates/egui_demo_lib/src/easy_mark/easy_mark_parser.rs @@ -13,7 +13,7 @@ pub enum Item<'a> { // TODO(emilk): add Style here so empty heading still uses up the right amount of space. Newline, - /// + /// title Text(Style, &'a str), /// title, url diff --git a/crates/egui_extras/src/table.rs b/crates/egui_extras/src/table.rs index c8b8c5006a6..1a7645c8cc5 100644 --- a/crates/egui_extras/src/table.rs +++ b/crates/egui_extras/src/table.rs @@ -1213,7 +1213,7 @@ impl<'a> TableBody<'a> { // Capture the hover information for the just created row. This is used in the next render // to ensure that the entire row is highlighted. - fn capture_hover_state(&mut self, response: &Option, row_index: usize) { + fn capture_hover_state(&self, response: &Option, row_index: usize) { let is_row_hovered = response.as_ref().map_or(false, |r| r.hovered()); if is_row_hovered { self.layout diff --git a/crates/egui_glow/src/shader_version.rs b/crates/egui_glow/src/shader_version.rs index 77c1e63cea9..4e9aef1fc20 100644 --- a/crates/egui_glow/src/shader_version.rs +++ b/crates/egui_glow/src/shader_version.rs @@ -12,7 +12,7 @@ pub enum ShaderVersion { /// OpenGL 1.4 or later Gl140, - /// e.g. WebGL1 + /// e.g. `WebGL1` Es100, /// e.g. WebGL2 diff --git a/crates/emath/src/numeric.rs b/crates/emath/src/numeric.rs index 03d00077129..9a7814b23d2 100644 --- a/crates/emath/src/numeric.rs +++ b/crates/emath/src/numeric.rs @@ -18,8 +18,8 @@ macro_rules! impl_numeric_float { ($t: ident) => { impl Numeric for $t { const INTEGRAL: bool = false; - const MIN: Self = std::$t::MIN; - const MAX: Self = std::$t::MAX; + const MIN: Self = $t::MIN; + const MAX: Self = $t::MAX; #[inline(always)] fn to_f64(self) -> f64 { @@ -44,8 +44,8 @@ macro_rules! impl_numeric_integer { ($t: ident) => { impl Numeric for $t { const INTEGRAL: bool = true; - const MIN: Self = std::$t::MIN; - const MAX: Self = std::$t::MAX; + const MIN: Self = $t::MIN; + const MAX: Self = $t::MAX; #[inline(always)] fn to_f64(self) -> f64 { diff --git a/crates/emath/src/rect.rs b/crates/emath/src/rect.rs index 6c0677ad55e..12770fa3e1c 100644 --- a/crates/emath/src/rect.rs +++ b/crates/emath/src/rect.rs @@ -1,4 +1,3 @@ -use std::f32::INFINITY; use std::fmt; use crate::{lerp, pos2, vec2, Div, Mul, Pos2, Rangef, Rot2, Vec2}; @@ -33,8 +32,8 @@ pub struct Rect { impl Rect { /// Infinite rectangle that contains every point. pub const EVERYTHING: Self = Self { - min: pos2(-INFINITY, -INFINITY), - max: pos2(INFINITY, INFINITY), + min: pos2(-f32::INFINITY, -f32::INFINITY), + max: pos2(f32::INFINITY, f32::INFINITY), }; /// The inverse of [`Self::EVERYTHING`]: stretches from positive infinity to negative infinity. @@ -53,8 +52,8 @@ impl Rect { /// assert_eq!(rect, Rect::from_min_max(pos2(0.0, 1.0), pos2(2.0, 3.0))) /// ``` pub const NOTHING: Self = Self { - min: pos2(INFINITY, INFINITY), - max: pos2(-INFINITY, -INFINITY), + min: pos2(f32::INFINITY, f32::INFINITY), + max: pos2(-f32::INFINITY, -f32::INFINITY), }; /// An invalid [`Rect`] filled with [`f32::NAN`]. diff --git a/crates/emath/src/smart_aim.rs b/crates/emath/src/smart_aim.rs index 88b807cf80b..57a8750ad2f 100644 --- a/crates/emath/src/smart_aim.rs +++ b/crates/emath/src/smart_aim.rs @@ -138,17 +138,22 @@ fn test_aim() { assert_eq!(best_in_range_f64(99.999, 100.000), 100.0); assert_eq!(best_in_range_f64(10.001, 100.001), 100.0); - use std::f64::{INFINITY, NAN, NEG_INFINITY}; - assert!(best_in_range_f64(NAN, NAN).is_nan()); - assert_eq!(best_in_range_f64(NAN, 1.2), 1.2); - assert_eq!(best_in_range_f64(NAN, INFINITY), INFINITY); - assert_eq!(best_in_range_f64(1.2, NAN), 1.2); - assert_eq!(best_in_range_f64(1.2, INFINITY), 1.2); - assert_eq!(best_in_range_f64(INFINITY, 1.2), 1.2); - assert_eq!(best_in_range_f64(NEG_INFINITY, 1.2), 0.0); - assert_eq!(best_in_range_f64(NEG_INFINITY, -2.7), -2.7); - assert_eq!(best_in_range_f64(INFINITY, INFINITY), INFINITY); - assert_eq!(best_in_range_f64(NEG_INFINITY, NEG_INFINITY), NEG_INFINITY); - assert_eq!(best_in_range_f64(NEG_INFINITY, INFINITY), 0.0); - assert_eq!(best_in_range_f64(INFINITY, NEG_INFINITY), 0.0); + assert!(best_in_range_f64(f64::NAN, f64::NAN).is_nan()); + assert_eq!(best_in_range_f64(f64::NAN, 1.2), 1.2); + assert_eq!(best_in_range_f64(f64::NAN, f64::INFINITY), f64::INFINITY); + assert_eq!(best_in_range_f64(1.2, f64::NAN), 1.2); + assert_eq!(best_in_range_f64(1.2, f64::INFINITY), 1.2); + assert_eq!(best_in_range_f64(f64::INFINITY, 1.2), 1.2); + assert_eq!(best_in_range_f64(f64::NEG_INFINITY, 1.2), 0.0); + assert_eq!(best_in_range_f64(f64::NEG_INFINITY, -2.7), -2.7); + assert_eq!( + best_in_range_f64(f64::INFINITY, f64::INFINITY), + f64::INFINITY + ); + assert_eq!( + best_in_range_f64(f64::NEG_INFINITY, f64::NEG_INFINITY), + f64::NEG_INFINITY + ); + assert_eq!(best_in_range_f64(f64::NEG_INFINITY, f64::INFINITY), 0.0); + assert_eq!(best_in_range_f64(f64::INFINITY, f64::NEG_INFINITY), 0.0); } diff --git a/crates/epaint/src/bezier.rs b/crates/epaint/src/bezier.rs index 7c55352cfeb..131df1073cd 100644 --- a/crates/epaint/src/bezier.rs +++ b/crates/epaint/src/bezier.rs @@ -211,8 +211,8 @@ impl CubicBezierShape { /// + t^2 * ( (3 * P2.x - 6 * P1.x + 3 * P0.x) * (P3.y - P0.y) - (3 * P2.y - 6 * P1.y + 3 * P0.y) * (P3.x - P0.x)) /// + t^1 * ( (3 * P1.x - 3 * P0.x) * (P3.y - P0.y) - (3 * P1.y - 3 * P0.y) * (P3.x - P0.x)) /// + (P0.x * (P3.y - P0.y) - P0.y * (P3.x - P0.x)) + P0.x * (P0.y - P3.y) + P0.y * (P3.x - P0.x) - /// = 0 - /// or a * t^3 + b * t^2 + c * t + d = 0 + /// = 0 + /// or a * t^3 + b * t^2 + c * t + d = 0 /// /// let x = t - b / (3 * a), then we have: /// x^3 + p * x + q = 0, where: diff --git a/crates/epaint/src/text/text_layout_types.rs b/crates/epaint/src/text/text_layout_types.rs index 17826e6afb1..a733de3c8f2 100644 --- a/crates/epaint/src/text/text_layout_types.rs +++ b/crates/epaint/src/text/text_layout_types.rs @@ -623,10 +623,10 @@ pub struct Glyph { /// The row/line height of this font. pub font_height: f32, - /// The ascent of the sub-font within the font ("FontImpl"). + /// The ascent of the sub-font within the font ("`FontImpl`"). pub font_impl_ascent: f32, - /// The row/line height of the sub-font within the font ("FontImpl"). + /// The row/line height of the sub-font within the font ("`FontImpl`"). pub font_impl_height: f32, /// Position and size of the glyph in the font texture, in texels. diff --git a/crates/epaint/src/texture_handle.rs b/crates/epaint/src/texture_handle.rs index f4142d91510..b0143d1d7d1 100644 --- a/crates/epaint/src/texture_handle.rs +++ b/crates/epaint/src/texture_handle.rs @@ -66,7 +66,7 @@ impl TextureHandle { } /// Assign a new image to an existing texture. - pub fn set(&mut self, image: impl Into, options: TextureOptions) { + pub fn set(&self, image: impl Into, options: TextureOptions) { self.tex_mngr .write() .set(self.id, ImageDelta::full(image.into(), options)); @@ -74,7 +74,7 @@ impl TextureHandle { /// Assign a new image to a subregion of the whole texture. pub fn set_partial( - &mut self, + &self, pos: [usize; 2], image: impl Into, options: TextureOptions, diff --git a/examples/confirm_exit/Cargo.toml b/examples/confirm_exit/Cargo.toml index b1cab21a1bb..c3050c32de9 100644 --- a/examples/confirm_exit/Cargo.toml +++ b/examples/confirm_exit/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Emil Ernerfeldt "] license = "MIT OR Apache-2.0" edition = "2021" -rust-version = "1.76" +rust-version = "1.81" publish = false [lints] diff --git a/examples/custom_3d_glow/Cargo.toml b/examples/custom_3d_glow/Cargo.toml index 3b8c9a45383..3ed54df786f 100644 --- a/examples/custom_3d_glow/Cargo.toml +++ b/examples/custom_3d_glow/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Emil Ernerfeldt "] license = "MIT OR Apache-2.0" edition = "2021" -rust-version = "1.76" +rust-version = "1.81" publish = false [lints] diff --git a/examples/custom_font/Cargo.toml b/examples/custom_font/Cargo.toml index d6021c12425..afaeb411735 100644 --- a/examples/custom_font/Cargo.toml +++ b/examples/custom_font/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Emil Ernerfeldt "] license = "MIT OR Apache-2.0" edition = "2021" -rust-version = "1.76" +rust-version = "1.81" publish = false [lints] diff --git a/examples/custom_font_style/Cargo.toml b/examples/custom_font_style/Cargo.toml index 65b5045238c..f64a4880309 100644 --- a/examples/custom_font_style/Cargo.toml +++ b/examples/custom_font_style/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["tami5 "] license = "MIT OR Apache-2.0" edition = "2021" -rust-version = "1.76" +rust-version = "1.81" publish = false [lints] diff --git a/examples/custom_keypad/Cargo.toml b/examples/custom_keypad/Cargo.toml index 7d000fd0d46..7e765e4ecb3 100644 --- a/examples/custom_keypad/Cargo.toml +++ b/examples/custom_keypad/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Varphone Wong "] license = "MIT OR Apache-2.0" edition = "2021" -rust-version = "1.76" +rust-version = "1.81" publish = false [lints] diff --git a/examples/custom_style/Cargo.toml b/examples/custom_style/Cargo.toml index 23f8a4e93c8..3a11bc6db30 100644 --- a/examples/custom_style/Cargo.toml +++ b/examples/custom_style/Cargo.toml @@ -3,7 +3,7 @@ name = "custom_style" version = "0.1.0" license = "MIT OR Apache-2.0" edition = "2021" -rust-version = "1.76" +rust-version = "1.81" publish = false [lints] diff --git a/examples/custom_window_frame/Cargo.toml b/examples/custom_window_frame/Cargo.toml index 6b800d0a0af..b0e89c8a622 100644 --- a/examples/custom_window_frame/Cargo.toml +++ b/examples/custom_window_frame/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Emil Ernerfeldt "] license = "MIT OR Apache-2.0" edition = "2021" -rust-version = "1.76" +rust-version = "1.81" publish = false [lints] diff --git a/examples/file_dialog/Cargo.toml b/examples/file_dialog/Cargo.toml index 9684a423256..76c2e95371c 100644 --- a/examples/file_dialog/Cargo.toml +++ b/examples/file_dialog/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Emil Ernerfeldt "] license = "MIT OR Apache-2.0" edition = "2021" -rust-version = "1.76" +rust-version = "1.81" publish = false [lints] diff --git a/examples/hello_world/Cargo.toml b/examples/hello_world/Cargo.toml index bdd728a61e1..1e4b553db85 100644 --- a/examples/hello_world/Cargo.toml +++ b/examples/hello_world/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Emil Ernerfeldt "] license = "MIT OR Apache-2.0" edition = "2021" -rust-version = "1.76" +rust-version = "1.81" publish = false [lints] diff --git a/examples/hello_world_par/Cargo.toml b/examples/hello_world_par/Cargo.toml index a64e7c0e9b0..e00252e4548 100644 --- a/examples/hello_world_par/Cargo.toml +++ b/examples/hello_world_par/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Maxim Osipenko "] license = "MIT OR Apache-2.0" edition = "2021" -rust-version = "1.76" +rust-version = "1.81" publish = false [lints] @@ -25,6 +25,4 @@ env_logger = { version = "0.10", default-features = false, features = [ ] } # This is normally enabled by eframe/default, which is not being used here # because of accesskit, as mentioned above -winit = { workspace = true, features = [ - "default" -] } +winit = { workspace = true, features = ["default"] } diff --git a/examples/hello_world_simple/Cargo.toml b/examples/hello_world_simple/Cargo.toml index c88382b9f6d..db1d7906de5 100644 --- a/examples/hello_world_simple/Cargo.toml +++ b/examples/hello_world_simple/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Emil Ernerfeldt "] license = "MIT OR Apache-2.0" edition = "2021" -rust-version = "1.76" +rust-version = "1.81" publish = false [lints] diff --git a/examples/images/Cargo.toml b/examples/images/Cargo.toml index 57d552e3be4..c64fc1a6e38 100644 --- a/examples/images/Cargo.toml +++ b/examples/images/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Jan Procházka "] license = "MIT OR Apache-2.0" edition = "2021" -rust-version = "1.76" +rust-version = "1.81" publish = false [lints] diff --git a/examples/keyboard_events/Cargo.toml b/examples/keyboard_events/Cargo.toml index f7b12047062..d57f17193fc 100644 --- a/examples/keyboard_events/Cargo.toml +++ b/examples/keyboard_events/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Jose Palazon "] license = "MIT OR Apache-2.0" edition = "2021" -rust-version = "1.76" +rust-version = "1.81" publish = false [lints] diff --git a/examples/multiple_viewports/Cargo.toml b/examples/multiple_viewports/Cargo.toml index 7aad28550fc..d5efc23df98 100644 --- a/examples/multiple_viewports/Cargo.toml +++ b/examples/multiple_viewports/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Emil Ernerfeldt "] license = "MIT OR Apache-2.0" edition = "2021" -rust-version = "1.76" +rust-version = "1.81" publish = false [lints] diff --git a/examples/puffin_profiler/Cargo.toml b/examples/puffin_profiler/Cargo.toml index 4527d5c269b..01f5efb8a16 100644 --- a/examples/puffin_profiler/Cargo.toml +++ b/examples/puffin_profiler/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Emil Ernerfeldt "] license = "MIT OR Apache-2.0" edition = "2021" -rust-version = "1.76" +rust-version = "1.81" publish = false [lints] diff --git a/examples/screenshot/Cargo.toml b/examples/screenshot/Cargo.toml index 84399e4bc24..b5a22ce7b11 100644 --- a/examples/screenshot/Cargo.toml +++ b/examples/screenshot/Cargo.toml @@ -7,7 +7,7 @@ authors = [ ] license = "MIT OR Apache-2.0" edition = "2021" -rust-version = "1.76" +rust-version = "1.81" publish = false [lints] diff --git a/examples/serial_windows/Cargo.toml b/examples/serial_windows/Cargo.toml index 5d52826e919..c18a6029d59 100644 --- a/examples/serial_windows/Cargo.toml +++ b/examples/serial_windows/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Emil Ernerfeldt "] license = "MIT OR Apache-2.0" edition = "2021" -rust-version = "1.76" +rust-version = "1.81" publish = false [lints] diff --git a/examples/user_attention/Cargo.toml b/examples/user_attention/Cargo.toml index 6c3c91cdc25..3ae28d69371 100644 --- a/examples/user_attention/Cargo.toml +++ b/examples/user_attention/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["TicClick "] license = "MIT OR Apache-2.0" edition = "2021" -rust-version = "1.76" +rust-version = "1.81" publish = false [lints] diff --git a/rust-toolchain b/rust-toolchain index 871f562485d..0eefd31bc5a 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -5,6 +5,6 @@ # to the user in the error, instead of "error: invalid channel name '[toolchain]'". [toolchain] -channel = "1.76.0" +channel = "1.81.0" components = ["rustfmt", "clippy"] targets = ["wasm32-unknown-unknown"] diff --git a/scripts/check.sh b/scripts/check.sh index 6f4aee69ec3..3aac7b745d2 100755 --- a/scripts/check.sh +++ b/scripts/check.sh @@ -9,7 +9,7 @@ set -x # Checks all tests, lints etc. # Basically does what the CI does. -cargo +1.76.0 install --quiet typos-cli +cargo +1.81.0 install --quiet typos-cli export RUSTFLAGS="-D warnings" export RUSTDOCFLAGS="-D warnings" # https://github.com/emilk/egui/pull/1454 @@ -34,20 +34,20 @@ cargo test --quiet --doc # slow - checks all doc-tests cargo check --quiet -p eframe --no-default-features --features "glow" if [[ "$OSTYPE" == "linux-gnu"* ]]; then - cargo check --quiet -p eframe --no-default-features --features "wgpu","x11" - cargo check --quiet -p eframe --no-default-features --features "wgpu","wayland" + cargo check --quiet -p eframe --no-default-features --features "wgpu","x11" + cargo check --quiet -p eframe --no-default-features --features "wgpu","wayland" else - cargo check --quiet -p eframe --no-default-features --features "wgpu" + cargo check --quiet -p eframe --no-default-features --features "wgpu" fi cargo check --quiet -p egui --no-default-features --features "serde" cargo check --quiet -p egui_demo_app --no-default-features --features "glow" if [[ "$OSTYPE" == "linux-gnu"* ]]; then - cargo check --quiet -p egui_demo_app --no-default-features --features "wgpu","x11" - cargo check --quiet -p egui_demo_app --no-default-features --features "wgpu","wayland" + cargo check --quiet -p egui_demo_app --no-default-features --features "wgpu","x11" + cargo check --quiet -p egui_demo_app --no-default-features --features "wgpu","wayland" else - cargo check --quiet -p egui_demo_app --no-default-features --features "wgpu" + cargo check --quiet -p egui_demo_app --no-default-features --features "wgpu" fi cargo check --quiet -p egui_demo_lib --no-default-features diff --git a/scripts/clippy_wasm/clippy.toml b/scripts/clippy_wasm/clippy.toml index f91ef9dd614..a3d03f70c7f 100644 --- a/scripts/clippy_wasm/clippy.toml +++ b/scripts/clippy_wasm/clippy.toml @@ -6,7 +6,7 @@ # ----------------------------------------------------------------------------- # Section identical to the root clippy.toml: -msrv = "1.76" +msrv = "1.81" allow-unwrap-in-tests = true diff --git a/tests/test_egui_extras_compilation/Cargo.toml b/tests/test_egui_extras_compilation/Cargo.toml index 167a8fa288c..38373028ec2 100644 --- a/tests/test_egui_extras_compilation/Cargo.toml +++ b/tests/test_egui_extras_compilation/Cargo.toml @@ -3,7 +3,7 @@ name = "test_egui_extras_compilation" version = "0.1.0" license = "MIT OR Apache-2.0" edition = "2021" -rust-version = "1.76" +rust-version = "1.81" publish = false [lints] diff --git a/tests/test_inline_glow_paint/Cargo.toml b/tests/test_inline_glow_paint/Cargo.toml index ae66b6abdd3..15cb21640a4 100644 --- a/tests/test_inline_glow_paint/Cargo.toml +++ b/tests/test_inline_glow_paint/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Emil Ernerfeldt "] license = "MIT OR Apache-2.0" edition = "2021" -rust-version = "1.76" +rust-version = "1.81" publish = false [lints] diff --git a/tests/test_size_pass/Cargo.toml b/tests/test_size_pass/Cargo.toml index 6886c7af2a1..a44f2cc0b67 100644 --- a/tests/test_size_pass/Cargo.toml +++ b/tests/test_size_pass/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Emil Ernerfeldt "] license = "MIT OR Apache-2.0" edition = "2021" -rust-version = "1.76" +rust-version = "1.81" publish = false [lints] diff --git a/tests/test_ui_stack/Cargo.toml b/tests/test_ui_stack/Cargo.toml index ebcbf077194..dd8bdb5de38 100644 --- a/tests/test_ui_stack/Cargo.toml +++ b/tests/test_ui_stack/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Antoine Beyeler "] license = "MIT OR Apache-2.0" edition = "2021" -rust-version = "1.76" +rust-version = "1.81" publish = false [lints] diff --git a/tests/test_viewports/Cargo.toml b/tests/test_viewports/Cargo.toml index 142bafe2293..2636b51774e 100644 --- a/tests/test_viewports/Cargo.toml +++ b/tests/test_viewports/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["konkitoman"] license = "MIT OR Apache-2.0" edition = "2021" -rust-version = "1.76" +rust-version = "1.81" publish = false [lints]