Skip to content

Commit 2cd3485

Browse files
authored
Update MSRV from 1.76 to 1.77 (#5322)
<!-- Please read the "Making a PR" section of [`CONTRIBUTING.md`](https://github.com/emilk/egui/blob/master/CONTRIBUTING.md) before opening a Pull Request! * Keep your PR:s small and focused. * The PR title is what ends up in the changelog, so make it descriptive! * If applicable, add a screenshot or gif. * If it is a non-trivial addition, consider adding a demo for it to `egui_demo_lib`, or a new example. * Do NOT open PR:s from your `master` branch, as that makes it hard for maintainers to test and add commits to your PR. * Remember to run `cargo fmt` and `cargo clippy`. * Open the PR as a draft until you have self-reviewed it and run `./scripts/check.sh`. * When you have addressed a PR comment, mark it as resolved. Please be patient! I will review your PR, but my time is limited! --> * [X] I have followed the instructions in the PR template I am preparing a separate PR that adds support for JXL with `jxl-oxide`, which is unlikely to be added to the `image` crate anytime soon (more context will be provided in that PR). `jxl-oxide` makes use of the [`array::each_mut`](https://doc.rust-lang.org/stable/std/primitive.array.html#method.each_mut) API which was stabilized in 1.77, which is the motivation for this MSRV bump. Rust 1.77 was officially released to stable on 21 March, 2024.
1 parent dafcfda commit 2cd3485

File tree

34 files changed

+43
-44
lines changed

34 files changed

+43
-44
lines changed

.github/workflows/deploy_web_demo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
with:
4040
profile: minimal
4141
target: wasm32-unknown-unknown
42-
toolchain: 1.76.0
42+
toolchain: 1.77.0
4343
override: true
4444

4545
- uses: Swatinem/rust-cache@v2

.github/workflows/rust.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
- uses: dtolnay/rust-toolchain@master
2020
with:
21-
toolchain: 1.76.0
21+
toolchain: 1.77.0
2222

2323
- name: Install packages (Linux)
2424
if: runner.os == 'Linux'
@@ -83,7 +83,7 @@ jobs:
8383
- uses: actions/checkout@v4
8484
- uses: dtolnay/rust-toolchain@master
8585
with:
86-
toolchain: 1.76.0
86+
toolchain: 1.77.0
8787
targets: wasm32-unknown-unknown
8888

8989
- run: sudo apt-get update && sudo apt-get install libgtk-3-dev libatk1.0-dev
@@ -155,7 +155,7 @@ jobs:
155155
- uses: actions/checkout@v4
156156
- uses: EmbarkStudios/cargo-deny-action@v1
157157
with:
158-
rust-version: "1.76.0"
158+
rust-version: "1.77.0"
159159
log-level: error
160160
command: check
161161
arguments: --target ${{ matrix.target }}
@@ -170,7 +170,7 @@ jobs:
170170

171171
- uses: dtolnay/rust-toolchain@master
172172
with:
173-
toolchain: 1.76.0
173+
toolchain: 1.77.0
174174
targets: aarch64-linux-android
175175

176176
- name: Set up cargo cache
@@ -189,7 +189,7 @@ jobs:
189189

190190
- uses: dtolnay/rust-toolchain@master
191191
with:
192-
toolchain: 1.76.0
192+
toolchain: 1.77.0
193193
targets: aarch64-apple-ios
194194

195195
- name: Set up cargo cache
@@ -208,7 +208,7 @@ jobs:
208208
- uses: actions/checkout@v4
209209
- uses: dtolnay/rust-toolchain@master
210210
with:
211-
toolchain: 1.76.0
211+
toolchain: 1.77.0
212212

213213
- name: Set up cargo cache
214214
uses: Swatinem/rust-cache@v2
@@ -232,7 +232,7 @@ jobs:
232232
lfs: true
233233
- uses: dtolnay/rust-toolchain@master
234234
with:
235-
toolchain: 1.76.0
235+
toolchain: 1.77.0
236236

237237
- name: Set up cargo cache
238238
uses: Swatinem/rust-cache@v2

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ members = [
2323
[workspace.package]
2424
edition = "2021"
2525
license = "MIT OR Apache-2.0"
26-
rust-version = "1.76"
26+
rust-version = "1.77"
2727
version = "0.29.1"
2828

2929

clippy.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# -----------------------------------------------------------------------------
44
# Section identical to scripts/clippy_wasm/clippy.toml:
55

6-
msrv = "1.76"
6+
msrv = "1.77"
77

88
allow-unwrap-in-tests = true
99

crates/ecolor/src/hex_color_macro.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,10 @@
4040
macro_rules! hex_color {
4141
($s:literal) => {{
4242
let array = $crate::color_hex::color_from_hex!($s);
43-
if array.len() == 3 {
44-
$crate::Color32::from_rgb(array[0], array[1], array[2])
45-
} else {
46-
#[allow(unconditional_panic)]
47-
$crate::Color32::from_rgba_unmultiplied(array[0], array[1], array[2], array[3])
43+
match array.as_slice() {
44+
[r, g, b] => $crate::Color32::from_rgb(*r, *g, *b),
45+
[r, g, b, a] => $crate::Color32::from_rgba_unmultiplied(*r, *g, *b, *a),
46+
_ => panic!("Invalid hex color length: expected 3 (RGB) or 4 (RGBA) bytes"),
4847
}
4948
}};
5049
}

crates/eframe/src/native/event_loop_context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::cell::Cell;
22
use winit::event_loop::ActiveEventLoop;
33

44
thread_local! {
5-
static CURRENT_EVENT_LOOP: Cell<Option<*const ActiveEventLoop>> = Cell::new(None);
5+
static CURRENT_EVENT_LOOP: Cell<Option<*const ActiveEventLoop>> = const { Cell::new(None) };
66
}
77

88
struct EventLoopGuard;

crates/eframe/src/native/run.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ fn with_event_loop<R>(
3737
mut native_options: epi::NativeOptions,
3838
f: impl FnOnce(&mut EventLoop<UserEvent>, epi::NativeOptions) -> R,
3939
) -> Result<R> {
40-
thread_local!(static EVENT_LOOP: std::cell::RefCell<Option<EventLoop<UserEvent>>> = std::cell::RefCell::new(None));
40+
thread_local!(static EVENT_LOOP: std::cell::RefCell<Option<EventLoop<UserEvent>>> = const { std::cell::RefCell::new(None) });
4141

4242
EVENT_LOOP.with(|event_loop| {
4343
// Since we want to reference NativeOptions when creating the EventLoop we can't

crates/egui/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! Try the live web demo: <https://www.egui.rs/#demo>. Read more about egui at <https://github.com/emilk/egui>.
44
//!
55
//! `egui` is in heavy development, with each new version having breaking changes.
6-
//! You need to have rust 1.76.0 or later to use `egui`.
6+
//! You need to have rust 1.77.0 or later to use `egui`.
77
//!
88
//! To quickly get started with egui, you can take a look at [`eframe_template`](https://github.com/emilk/eframe_template)
99
//! which uses [`eframe`](https://docs.rs/eframe).

examples/confirm_exit/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
55
license = "MIT OR Apache-2.0"
66
edition = "2021"
7-
rust-version = "1.76"
7+
rust-version = "1.77"
88
publish = false
99

1010
[lints]

examples/custom_3d_glow/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
55
license = "MIT OR Apache-2.0"
66
edition = "2021"
7-
rust-version = "1.76"
7+
rust-version = "1.77"
88
publish = false
99

1010
[lints]

examples/custom_font/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
55
license = "MIT OR Apache-2.0"
66
edition = "2021"
7-
rust-version = "1.76"
7+
rust-version = "1.77"
88
publish = false
99

1010
[lints]

examples/custom_font_style/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
authors = ["tami5 <kkharji@proton.me>"]
55
license = "MIT OR Apache-2.0"
66
edition = "2021"
7-
rust-version = "1.76"
7+
rust-version = "1.77"
88
publish = false
99

1010
[lints]

examples/custom_keypad/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
authors = ["Varphone Wong <varphone@qq.com>"]
55
license = "MIT OR Apache-2.0"
66
edition = "2021"
7-
rust-version = "1.76"
7+
rust-version = "1.77"
88
publish = false
99

1010
[lints]

examples/custom_style/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "custom_style"
33
version = "0.1.0"
44
license = "MIT OR Apache-2.0"
55
edition = "2021"
6-
rust-version = "1.76"
6+
rust-version = "1.77"
77
publish = false
88

99
[lints]

examples/custom_window_frame/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
55
license = "MIT OR Apache-2.0"
66
edition = "2021"
7-
rust-version = "1.76"
7+
rust-version = "1.77"
88
publish = false
99

1010
[lints]

examples/file_dialog/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
55
license = "MIT OR Apache-2.0"
66
edition = "2021"
7-
rust-version = "1.76"
7+
rust-version = "1.77"
88
publish = false
99

1010
[lints]

examples/hello_world/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
55
license = "MIT OR Apache-2.0"
66
edition = "2021"
7-
rust-version = "1.76"
7+
rust-version = "1.77"
88
publish = false
99

1010
[lints]

examples/hello_world_par/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
authors = ["Maxim Osipenko <maxim1999max@gmail.com>"]
55
license = "MIT OR Apache-2.0"
66
edition = "2021"
7-
rust-version = "1.76"
7+
rust-version = "1.77"
88
publish = false
99

1010
[lints]

examples/hello_world_simple/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
55
license = "MIT OR Apache-2.0"
66
edition = "2021"
7-
rust-version = "1.76"
7+
rust-version = "1.77"
88
publish = false
99

1010
[lints]

examples/images/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
authors = ["Jan Procházka <github.com/jprochazk>"]
55
license = "MIT OR Apache-2.0"
66
edition = "2021"
7-
rust-version = "1.76"
7+
rust-version = "1.77"
88
publish = false
99

1010
[lints]

examples/keyboard_events/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
authors = ["Jose Palazon <jose@palako.com>"]
55
license = "MIT OR Apache-2.0"
66
edition = "2021"
7-
rust-version = "1.76"
7+
rust-version = "1.77"
88
publish = false
99

1010
[lints]

examples/multiple_viewports/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
55
license = "MIT OR Apache-2.0"
66
edition = "2021"
7-
rust-version = "1.76"
7+
rust-version = "1.77"
88
publish = false
99

1010
[lints]

examples/puffin_profiler/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
55
license = "MIT OR Apache-2.0"
66
edition = "2021"
7-
rust-version = "1.76"
7+
rust-version = "1.77"
88
publish = false
99

1010
[lints]

examples/screenshot/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ authors = [
77
]
88
license = "MIT OR Apache-2.0"
99
edition = "2021"
10-
rust-version = "1.76"
10+
rust-version = "1.77"
1111
publish = false
1212

1313
[lints]

examples/serial_windows/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
55
license = "MIT OR Apache-2.0"
66
edition = "2021"
7-
rust-version = "1.76"
7+
rust-version = "1.77"
88
publish = false
99

1010
[lints]

examples/user_attention/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
authors = ["TicClick <ya@ticclick.ch>"]
55
license = "MIT OR Apache-2.0"
66
edition = "2021"
7-
rust-version = "1.76"
7+
rust-version = "1.77"
88
publish = false
99

1010
[lints]

rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
# to the user in the error, instead of "error: invalid channel name '[toolchain]'".
66

77
[toolchain]
8-
channel = "1.76.0"
8+
channel = "1.77.0"
99
components = ["rustfmt", "clippy"]
1010
targets = ["wasm32-unknown-unknown"]

scripts/check.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ set -x
99
# Checks all tests, lints etc.
1010
# Basically does what the CI does.
1111

12-
cargo +1.76.0 install --quiet typos-cli
12+
cargo +1.77.0 install --quiet typos-cli
1313

1414
export RUSTFLAGS="-D warnings"
1515
export RUSTDOCFLAGS="-D warnings" # https://github.com/emilk/egui/pull/1454

scripts/clippy_wasm/clippy.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# -----------------------------------------------------------------------------
77
# Section identical to the root clippy.toml:
88

9-
msrv = "1.76"
9+
msrv = "1.77"
1010

1111
allow-unwrap-in-tests = true
1212

tests/test_egui_extras_compilation/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "test_egui_extras_compilation"
33
version = "0.1.0"
44
license = "MIT OR Apache-2.0"
55
edition = "2021"
6-
rust-version = "1.76"
6+
rust-version = "1.77"
77
publish = false
88

99
[lints]

tests/test_inline_glow_paint/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
55
license = "MIT OR Apache-2.0"
66
edition = "2021"
7-
rust-version = "1.76"
7+
rust-version = "1.77"
88
publish = false
99

1010
[lints]

tests/test_size_pass/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
55
license = "MIT OR Apache-2.0"
66
edition = "2021"
7-
rust-version = "1.76"
7+
rust-version = "1.77"
88
publish = false
99

1010
[lints]

tests/test_ui_stack/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
authors = ["Antoine Beyeler <abeyeler@gmail.com>"]
55
license = "MIT OR Apache-2.0"
66
edition = "2021"
7-
rust-version = "1.76"
7+
rust-version = "1.77"
88
publish = false
99

1010
[lints]

tests/test_viewports/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
authors = ["konkitoman"]
55
license = "MIT OR Apache-2.0"
66
edition = "2021"
7-
rust-version = "1.76"
7+
rust-version = "1.77"
88
publish = false
99

1010
[lints]

0 commit comments

Comments
 (0)