Skip to content

Commit

Permalink
Update MSRV to 1.80 (#5457)
Browse files Browse the repository at this point in the history
Because some dependencies now require it, see:
* #5456
  • Loading branch information
emilk authored Dec 10, 2024
1 parent 9b1ae6b commit 53a926a
Show file tree
Hide file tree
Showing 42 changed files with 63 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy_web_demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
with:
profile: minimal
target: wasm32-unknown-unknown
toolchain: 1.79.0
toolchain: 1.80.0
override: true

- uses: Swatinem/rust-cache@v2
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.79.0
toolchain: 1.80.0

- name: Install packages (Linux)
if: runner.os == 'Linux'
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.79.0
toolchain: 1.80.0
targets: wasm32-unknown-unknown

- run: sudo apt-get update && sudo apt-get install libgtk-3-dev libatk1.0-dev
Expand Down Expand Up @@ -155,7 +155,7 @@ jobs:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1
with:
rust-version: "1.79.0"
rust-version: "1.80.0"
log-level: error
command: check
arguments: --target ${{ matrix.target }}
Expand All @@ -170,7 +170,7 @@ jobs:

- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.79.0
toolchain: 1.80.0
targets: aarch64-linux-android

- name: Set up cargo cache
Expand All @@ -189,7 +189,7 @@ jobs:

- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.79.0
toolchain: 1.80.0
targets: aarch64-apple-ios

- name: Set up cargo cache
Expand All @@ -208,7 +208,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.79.0
toolchain: 1.80.0

- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
Expand All @@ -232,7 +232,7 @@ jobs:
lfs: true
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.79.0
toolchain: 1.80.0

- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
Expand Down
11 changes: 6 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ members = [
[workspace.package]
edition = "2021"
license = "MIT OR Apache-2.0"
rust-version = "1.79"
rust-version = "1.80"
version = "0.29.1"


Expand Down Expand Up @@ -106,13 +106,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 = { level = "warn", priority = -1 }
nonstandard_style = { level = "warn", priority = -1 }
rust_2018_idioms = { level = "warn", priority = -1 }
rust_2021_prelude_collisions = "warn"
semicolon_in_expressions_from_macros = "warn"
trivial_numeric_casts = "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
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"
unused_lifetimes = "warn"
Expand Down Expand Up @@ -233,6 +233,7 @@ ref_patterns = "warn"
rest_pat_in_fully_bound_structs = "warn"
same_functions_in_if_condition = "warn"
semicolon_if_nothing_returned = "warn"
single_char_pattern = "warn"
single_match_else = "warn"
str_split_at_newline = "warn"
str_to_string = "warn"
Expand Down
2 changes: 1 addition & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# -----------------------------------------------------------------------------
# Section identical to scripts/clippy_wasm/clippy.toml:

msrv = "1.79"
msrv = "1.80"

allow-unwrap-in-tests = true

Expand Down
2 changes: 1 addition & 1 deletion crates/eframe/src/web/app_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion crates/egui-wgpu/src/winit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ impl Painter {
.retain(|id, _| active_viewports.contains(id));
}

#[allow(clippy::unused_self)]
#[allow(clippy::needless_pass_by_ref_mut, clippy::unused_self)]
pub fn destroy(&mut self) {
// TODO(emilk): something here?
}
Expand Down
4 changes: 2 additions & 2 deletions crates/egui/src/containers/resize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down Expand Up @@ -295,7 +295,7 @@ impl Resize {
}
}

pub fn show<R>(mut self, ui: &mut Ui, add_contents: impl FnOnce(&mut Ui) -> R) -> R {
pub fn show<R>(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);
Expand Down
4 changes: 2 additions & 2 deletions crates/egui/src/grid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion crates/egui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! Try the live web demo: <https://www.egui.rs/#demo>. Read more about egui at <https://github.com/emilk/egui>.
//!
//! `egui` is in heavy development, with each new version having breaking changes.
//! You need to have rust 1.79.0 or later to use `egui`.
//! You need to have rust 1.80.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).
Expand Down
5 changes: 4 additions & 1 deletion crates/egui/src/widgets/color_picker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,11 @@ 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].
///
/// 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(
ui: &mut Ui,
x_value: &mut f32,
Expand Down
1 change: 1 addition & 0 deletions crates/egui/src/widgets/text_edit/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ impl TextEditState {
self.undoer.lock().clone()
}

#[allow(clippy::needless_pass_by_ref_mut)] // Intentionally hide interiority of mutability
pub fn set_undoer(&mut self, undoer: TextEditUndoer) {
*self.undoer.lock() = undoer;
}
Expand Down
2 changes: 1 addition & 1 deletion crates/egui_demo_app/src/frame_history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion crates/egui_extras/src/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,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<Response>, row_index: usize) {
fn capture_hover_state(&self, response: &Option<Response>, row_index: usize) {
let is_row_hovered = response.as_ref().map_or(false, |r| r.hovered());
if is_row_hovered {
self.layout
Expand Down
2 changes: 1 addition & 1 deletion crates/egui_kittest/src/wgpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl TestRenderer {
}

/// Render the [`Harness`] and return the resulting image.
pub fn render<State>(&mut self, harness: &Harness<'_, State>) -> RgbaImage {
pub fn render<State>(&self, harness: &Harness<'_, State>) -> RgbaImage {
// We need to create a new renderer each time we render, since the renderer stores
// textures related to the Harnesses' egui Context.
// Calling the renderer from different Harnesses would cause problems if we store the renderer.
Expand Down
6 changes: 5 additions & 1 deletion crates/epaint/src/bezier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,17 +207,21 @@ impl CubicBezierShape {
/// B.x = (P3.x - 3 * P2.x + 3 * P1.x - P0.x) * t^3 + (3 * P2.x - 6 * P1.x + 3 * P0.x) * t^2 + (3 * P1.x - 3 * P0.x) * t + P0.x
/// B.y = (P3.y - 3 * P2.y + 3 * P1.y - P0.y) * t^3 + (3 * P2.y - 6 * P1.y + 3 * P0.y) * t^2 + (3 * P1.y - 3 * P0.y) * t + P0.y
/// Combine the above three equations and iliminate B.x and B.y, we get:
/// ```text
/// t^3 * ( (P3.x - 3*P2.x + 3*P1.x - P0.x) * (P3.y - P0.y) - (P3.y - 3*P2.y + 3*P1.y - P0.y) * (P3.x - P0.x))
/// + 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
/// ```
/// or `a * t^3 + b * t^2 + c * t + d = 0`
///
/// let x = t - b / (3 * a), then we have:
/// ```text
/// x^3 + p * x + q = 0, where:
/// p = (3.0 * a * c - b^2) / (3.0 * a^2)
/// q = (2.0 * b^3 - 9.0 * a * b * c + 27.0 * a^2 * d) / (27.0 * a^3)
/// ```
///
/// when p > 0, there will be one real root, two complex roots
/// when p = 0, there will be two real roots, when p=q=0, there will be three real roots but all 0.
Expand Down
2 changes: 2 additions & 0 deletions crates/epaint/src/texture_handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,15 @@ impl TextureHandle {
}

/// Assign a new image to an existing texture.
#[allow(clippy::needless_pass_by_ref_mut)] // Intentionally hide interiority of mutability
pub fn set(&mut self, image: impl Into<ImageData>, options: TextureOptions) {
self.tex_mngr
.write()
.set(self.id, ImageDelta::full(image.into(), options));
}

/// Assign a new image to a subregion of the whole texture.
#[allow(clippy::needless_pass_by_ref_mut)] // Intentionally hide interiority of mutability
pub fn set_partial(
&mut self,
pos: [usize; 2],
Expand Down
2 changes: 1 addition & 1 deletion examples/confirm_exit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Emil Ernerfeldt <[email protected]>"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false

[lints]
Expand Down
2 changes: 1 addition & 1 deletion examples/custom_3d_glow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Emil Ernerfeldt <[email protected]>"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false

[lints]
Expand Down
2 changes: 1 addition & 1 deletion examples/custom_font/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Emil Ernerfeldt <[email protected]>"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false

[lints]
Expand Down
2 changes: 1 addition & 1 deletion examples/custom_font_style/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["tami5 <[email protected]>"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false

[lints]
Expand Down
2 changes: 1 addition & 1 deletion examples/custom_keypad/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Varphone Wong <[email protected]>"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false

[lints]
Expand Down
2 changes: 1 addition & 1 deletion examples/custom_style/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "custom_style"
version = "0.1.0"
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false

[lints]
Expand Down
2 changes: 1 addition & 1 deletion examples/custom_window_frame/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Emil Ernerfeldt <[email protected]>"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false

[lints]
Expand Down
2 changes: 1 addition & 1 deletion examples/file_dialog/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Emil Ernerfeldt <[email protected]>"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false

[lints]
Expand Down
2 changes: 1 addition & 1 deletion examples/hello_world/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Emil Ernerfeldt <[email protected]>"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false

[lints]
Expand Down
2 changes: 1 addition & 1 deletion examples/hello_world_par/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Maxim Osipenko <[email protected]>"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false

[lints]
Expand Down
2 changes: 1 addition & 1 deletion examples/hello_world_simple/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Emil Ernerfeldt <[email protected]>"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false

[lints]
Expand Down
2 changes: 1 addition & 1 deletion examples/images/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Jan Procházka <github.com/jprochazk>"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false

[lints]
Expand Down
2 changes: 1 addition & 1 deletion examples/keyboard_events/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Jose Palazon <[email protected]>"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false

[lints]
Expand Down
2 changes: 1 addition & 1 deletion examples/multiple_viewports/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Emil Ernerfeldt <[email protected]>"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false

[lints]
Expand Down
Loading

0 comments on commit 53a926a

Please sign in to comment.