Skip to content

Commit bfadb90

Browse files
authored
Update MSRV to Rust 1.72 (#3595)
Required to update to puffin 0.18
1 parent 7abf8af commit bfadb90

File tree

48 files changed

+208
-192
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+208
-192
lines changed

.github/workflows/deploy_web_demo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
with:
4444
profile: minimal
4545
target: wasm32-unknown-unknown
46-
toolchain: 1.70.0
46+
toolchain: 1.72.0
4747
override: true
4848

4949
- uses: Swatinem/rust-cache@v2

.github/workflows/rust.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
- uses: dtolnay/rust-toolchain@master
2121
with:
22-
toolchain: 1.70.0
22+
toolchain: 1.72.0
2323

2424
- name: Install packages (Linux)
2525
if: runner.os == 'Linux'
@@ -93,7 +93,7 @@ jobs:
9393
- uses: actions/checkout@v4
9494
- uses: dtolnay/rust-toolchain@master
9595
with:
96-
toolchain: 1.70.0
96+
toolchain: 1.72.0
9797
targets: wasm32-unknown-unknown
9898

9999
- run: sudo apt-get update && sudo apt-get install libgtk-3-dev libatk1.0-dev
@@ -151,7 +151,7 @@ jobs:
151151
- uses: actions/checkout@v4
152152
- uses: EmbarkStudios/cargo-deny-action@v1
153153
with:
154-
rust-version: "1.70.0"
154+
rust-version: "1.72.0"
155155
log-level: error
156156
command: check
157157
arguments: --target ${{ matrix.target }}
@@ -166,7 +166,7 @@ jobs:
166166

167167
- uses: dtolnay/rust-toolchain@master
168168
with:
169-
toolchain: 1.70.0
169+
toolchain: 1.72.0
170170
targets: aarch64-linux-android
171171

172172
- name: Set up cargo cache
@@ -184,7 +184,7 @@ jobs:
184184
- uses: actions/checkout@v4
185185
- uses: dtolnay/rust-toolchain@master
186186
with:
187-
toolchain: 1.70.0
187+
toolchain: 1.72.0
188188

189189
- name: Set up cargo cache
190190
uses: Swatinem/rust-cache@v2

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ puffin = "0.17"
4040
raw-window-handle = "0.5.0"
4141
thiserror = "1.0.37"
4242

43-
wgpu = "0.18.0"
43+
# Make the renderer `Sync` even on wasm32, because it makes the code simpler:
44+
wgpu = { version = "0.18.0", features = ["fragile-send-sync-non-atomic-wasm"] }
45+
4446
# Use this to build wgpu with WebGL support on the Web *instead* of using WebGPU.
4547
#wgpu = { version = "0.18.0", features = ["webgl"] }

Cranky.toml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ warn = [
5555
"clippy::large_digit_groups",
5656
"clippy::large_include_file",
5757
"clippy::large_stack_arrays",
58+
"clippy::large_stack_frames",
5859
"clippy::large_types_passed_by_value",
5960
"clippy::let_unit_value",
6061
"clippy::linkedlist",
@@ -90,7 +91,9 @@ warn = [
9091
"clippy::option_option",
9192
"clippy::path_buf_push_overwrite",
9293
"clippy::ptr_as_ptr",
94+
"clippy::ptr_cast_constness",
9395
"clippy::rc_mutex",
96+
"clippy::redundant_type_annotations",
9497
"clippy::ref_option_ref",
9598
"clippy::rest_pat_in_fully_bound_structs",
9699
"clippy::same_functions_in_if_condition",
@@ -106,6 +109,7 @@ warn = [
106109
"clippy::todo",
107110
"clippy::trailing_empty_array",
108111
"clippy::trait_duplication_in_bounds",
112+
"clippy::tuple_array_conversions",
109113
"clippy::unchecked_duration_subtraction",
110114
"clippy::unimplemented",
111115
"clippy::uninlined_format_args",
@@ -129,23 +133,24 @@ warn = [
129133
"rustdoc::missing_crate_level_docs",
130134
"semicolon_in_expressions_from_macros",
131135
"trivial_numeric_casts",
136+
"unsafe_op_in_unsafe_fn", # `unsafe_op_in_unsafe_fn` may become the default in future Rust versions: https://github.com/rust-lang/rust/issues/71668
132137
"unused_extern_crates",
133138
"unused_import_braces",
134139
"unused_lifetimes",
135140
]
136141

137142
allow = [
138-
"clippy::manual_range_contains", # this one is just worse imho
139-
140-
"clippy::significant_drop_tightening", # False positives
143+
"clippy::manual_range_contains", # this one is just worse imho
144+
"clippy::significant_drop_tightening", # A lot of false positives
141145

142146
# TODO(emilk): enable more of these lints:
147+
"clippy::cloned_instead_of_copied",
143148
"clippy::let_underscore_untyped",
144149
"clippy::missing_assert_message",
150+
"clippy::missing_errors_doc",
145151
"clippy::undocumented_unsafe_blocks",
146152
"clippy::unwrap_used",
147-
"clippy::wildcard_imports",
153+
"clippy::wildcard_imports", # we do this a lot
148154
"trivial_casts",
149-
"unsafe_op_in_unsafe_fn", # `unsafe_op_in_unsafe_fn` may become the default in future Rust versions: https://github.com/rust-lang/rust/issues/71668
150155
"unused_qualifications",
151156
]

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.70"
6+
msrv = "1.72"
77

88
allow-unwrap-in-tests = true
99

crates/ecolor/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ authors = [
77
]
88
description = "Color structs and color conversion utilities"
99
edition = "2021"
10-
rust-version = "1.70"
10+
rust-version = "1.72"
1111
homepage = "https://github.com/emilk/egui"
1212
license = "MIT OR Apache-2.0"
1313
readme = "README.md"

crates/eframe/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.23.0"
44
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
55
description = "egui framework - write GUI apps that compiles to web and/or natively"
66
edition = "2021"
7-
rust-version = "1.70"
7+
rust-version = "1.72"
88
homepage = "https://github.com/emilk/egui/tree/master/crates/eframe"
99
license = "MIT OR Apache-2.0"
1010
readme = "README.md"

crates/eframe/src/native/glow_integration.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ impl GlutinWindowContext {
853853
.with_context_api(glutin::context::ContextApi::Gles(None))
854854
.build(raw_window_handle);
855855

856-
let gl_context_result = {
856+
let gl_context_result = unsafe {
857857
crate::profile_scope!("create_context");
858858
gl_config
859859
.display()
@@ -867,9 +867,11 @@ impl GlutinWindowContext {
867867
log::debug!(
868868
"Retrying with fallback context attributes: {fallback_context_attributes:?}"
869869
);
870-
gl_config
871-
.display()
872-
.create_context(&gl_config, &fallback_context_attributes)?
870+
unsafe {
871+
gl_config
872+
.display()
873+
.create_context(&gl_config, &fallback_context_attributes)?
874+
}
873875
}
874876
};
875877
let not_current_gl_context = Some(gl_context);

crates/egui-wgpu/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ authors = [
88
"Emil Ernerfeldt <emil.ernerfeldt@gmail.com>",
99
]
1010
edition = "2021"
11-
rust-version = "1.70"
11+
rust-version = "1.72"
1212
homepage = "https://github.com/emilk/egui/tree/master/crates/egui-wgpu"
1313
license = "MIT OR Apache-2.0"
1414
readme = "README.md"

crates/egui-wgpu/src/renderer.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@ use epaint::{ahash::HashMap, emath::NumExt, PaintCallbackInfo, Primitive, Vertex
77
use wgpu;
88
use wgpu::util::DeviceExt as _;
99

10-
// Only implements Send + Sync on wasm32 in order to allow storing wgpu resources on the type map.
11-
#[cfg(not(target_arch = "wasm32"))]
1210
pub type CallbackResources = type_map::concurrent::TypeMap;
13-
#[cfg(target_arch = "wasm32")]
14-
pub type CallbackResources = type_map::TypeMap;
1511

1612
pub struct Callback(Box<dyn CallbackTrait>);
1713

@@ -987,9 +983,6 @@ impl ScissorRect {
987983
}
988984
}
989985

990-
// Wgpu objects contain references to the JS heap on the web, therefore they are not Send/Sync.
991-
// It follows that egui_wgpu::Renderer can not be Send/Sync either when building with wasm.
992-
#[cfg(not(target_arch = "wasm32"))]
993986
#[test]
994987
fn renderer_impl_send_sync() {
995988
fn assert_send_sync<T: Send + Sync>() {}

crates/egui-winit/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.23.0"
44
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
55
description = "Bindings for using egui with winit"
66
edition = "2021"
7-
rust-version = "1.70"
7+
rust-version = "1.72"
88
homepage = "https://github.com/emilk/egui/tree/master/crates/egui-winit"
99
license = "MIT OR Apache-2.0"
1010
readme = "README.md"

crates/egui/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.23.0"
44
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
55
description = "An easy-to-use immediate mode GUI that runs on both web and native"
66
edition = "2021"
7-
rust-version = "1.70"
7+
rust-version = "1.72"
88
homepage = "https://github.com/emilk/egui"
99
license = "MIT OR Apache-2.0"
1010
readme = "../../README.md"

crates/egui/src/style.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,7 @@ impl Style {
13991399
fn text_styles_ui(ui: &mut Ui, text_styles: &mut BTreeMap<TextStyle, FontId>) -> Response {
14001400
ui.vertical(|ui| {
14011401
crate::Grid::new("text_styles").show(ui, |ui| {
1402-
for (text_style, font_id) in text_styles.iter_mut() {
1402+
for (text_style, font_id) in &mut *text_styles {
14031403
ui.label(RichText::new(text_style.to_string()).font(font_id.clone()));
14041404
crate::introspection::font_id_ui(ui, font_id);
14051405
ui.end_row();

crates/egui_demo_app/Cargo.toml

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

crates/egui_demo_lib/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.23.0"
44
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
55
description = "Example library for egui"
66
edition = "2021"
7-
rust-version = "1.70"
7+
rust-version = "1.72"
88
homepage = "https://github.com/emilk/egui/tree/master/crates/egui_demo_lib"
99
license = "MIT OR Apache-2.0"
1010
readme = "README.md"

crates/egui_extras/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ authors = [
88
]
99
description = "Extra functionality and widgets for the egui GUI library"
1010
edition = "2021"
11-
rust-version = "1.70"
11+
rust-version = "1.72"
1212
homepage = "https://github.com/emilk/egui"
1313
license = "MIT OR Apache-2.0"
1414
readme = "README.md"

crates/egui_glow/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.23.0"
44
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
55
description = "Bindings for using egui natively using the glow library"
66
edition = "2021"
7-
rust-version = "1.70"
7+
rust-version = "1.72"
88
homepage = "https://github.com/emilk/egui/tree/master/crates/egui_glow"
99
license = "MIT OR Apache-2.0"
1010
readme = "README.md"

crates/egui_glow/src/misc_util.rs

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,38 @@ pub(crate) unsafe fn compile_shader(
77
shader_type: u32,
88
source: &str,
99
) -> Result<glow::Shader, String> {
10-
let shader = gl.create_shader(shader_type)?;
10+
unsafe {
11+
let shader = gl.create_shader(shader_type)?;
1112

12-
gl.shader_source(shader, source);
13+
gl.shader_source(shader, source);
1314

14-
gl.compile_shader(shader);
15+
gl.compile_shader(shader);
1516

16-
if gl.get_shader_compile_status(shader) {
17-
Ok(shader)
18-
} else {
19-
Err(gl.get_shader_info_log(shader))
17+
if gl.get_shader_compile_status(shader) {
18+
Ok(shader)
19+
} else {
20+
Err(gl.get_shader_info_log(shader))
21+
}
2022
}
2123
}
2224

2325
pub(crate) unsafe fn link_program<'a, T: IntoIterator<Item = &'a glow::Shader>>(
2426
gl: &glow::Context,
2527
shaders: T,
2628
) -> Result<glow::Program, String> {
27-
let program = gl.create_program()?;
29+
unsafe {
30+
let program = gl.create_program()?;
2831

29-
for shader in shaders {
30-
gl.attach_shader(program, *shader);
31-
}
32+
for shader in shaders {
33+
gl.attach_shader(program, *shader);
34+
}
3235

33-
gl.link_program(program);
36+
gl.link_program(program);
3437

35-
if gl.get_program_link_status(program) {
36-
Ok(program)
37-
} else {
38-
Err(gl.get_program_info_log(program))
38+
if gl.get_program_link_status(program) {
39+
Ok(program)
40+
} else {
41+
Err(gl.get_program_info_log(program))
42+
}
3943
}
4044
}

0 commit comments

Comments
 (0)