Update MSRV to 1.80 (#5457)

Because some dependencies now require it, see:
* https://github.com/emilk/egui/pull/5456
This commit is contained in:
Emil Ernerfeldt 2024-12-10 16:09:03 +01:00 committed by GitHub
parent 9b1ae6b880
commit 53a926a428
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
42 changed files with 63 additions and 52 deletions

View File

@ -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

View File

@ -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'
@ -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
@ -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 }}
@ -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
@ -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
@ -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
@ -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

View File

@ -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"
@ -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"
@ -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"

View File

@ -3,7 +3,7 @@
# -----------------------------------------------------------------------------
# Section identical to scripts/clippy_wasm/clippy.toml:
msrv = "1.79"
msrv = "1.80"
allow-unwrap-in-tests = true

View File

@ -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());

View File

@ -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?
}

View File

@ -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<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);

View File

@ -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),

View File

@ -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).

View File

@ -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,

View File

@ -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;
}

View File

@ -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()

View File

@ -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

View File

@ -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.

View File

@ -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.

View File

@ -66,6 +66,7 @@ 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()
@ -73,6 +74,7 @@ impl TextureHandle {
}
/// 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],

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false
[lints]

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false
[lints]

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false
[lints]

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["tami5 <kkharji@proton.me>"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false
[lints]

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Varphone Wong <varphone@qq.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false
[lints]

View File

@ -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]

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false
[lints]

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false
[lints]

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false
[lints]

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Maxim Osipenko <maxim1999max@gmail.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false
[lints]

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false
[lints]

View File

@ -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]

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Jose Palazon <jose@palako.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false
[lints]

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false
[lints]

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false
[lints]

View File

@ -7,7 +7,7 @@ authors = [
]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false
[lints]

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false
[lints]

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["TicClick <ya@ticclick.ch>"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false
[lints]

View File

@ -5,6 +5,6 @@
# to the user in the error, instead of "error: invalid channel name '[toolchain]'".
[toolchain]
channel = "1.79.0"
channel = "1.80.0"
components = ["rustfmt", "clippy"]
targets = ["wasm32-unknown-unknown"]

View File

@ -9,7 +9,7 @@ set -x
# Checks all tests, lints etc.
# Basically does what the CI does.
cargo +1.79.0 install --quiet typos-cli
cargo +1.80.0 install --quiet typos-cli
export RUSTFLAGS="-D warnings"
export RUSTDOCFLAGS="-D warnings" # https://github.com/emilk/egui/pull/1454

View File

@ -6,7 +6,7 @@
# -----------------------------------------------------------------------------
# Section identical to the root clippy.toml:
msrv = "1.79"
msrv = "1.80"
allow-unwrap-in-tests = true

View File

@ -3,7 +3,7 @@ name = "test_egui_extras_compilation"
version = "0.1.0"
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false
[lints]

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false
[lints]

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false
[lints]

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Antoine Beyeler <abeyeler@gmail.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false
[lints]

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["konkitoman"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.79"
rust-version = "1.80"
publish = false
[lints]