Skip to content

Commit 922448c

Browse files
committed
Update to Rust 1.65 (#2314)
* Update to Rust 1.65 Because then you can use dynamic linking on Linux * Fix a bunch of clippy lints * Update changelogs * More clippy fixes
1 parent 938c56a commit 922448c

File tree

48 files changed

+195
-187
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

+195
-187
lines changed

.github/workflows/rust.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- uses: actions-rs/toolchain@v1
2020
with:
2121
profile: default
22-
toolchain: 1.64.0
22+
toolchain: 1.65.0
2323
override: true
2424
- name: Install packages (Linux)
2525
if: runner.os == 'Linux'
@@ -84,7 +84,7 @@ jobs:
8484
- uses: actions-rs/toolchain@v1
8585
with:
8686
profile: minimal
87-
toolchain: 1.64.0
87+
toolchain: 1.65.0
8888
target: wasm32-unknown-unknown
8989
override: true
9090

@@ -136,7 +136,7 @@ jobs:
136136
- uses: actions/checkout@v2
137137
- uses: EmbarkStudios/cargo-deny-action@v1
138138
with:
139-
rust-version: "1.62.0"
139+
rust-version: "1.65.0"
140140

141141
android:
142142
name: android
@@ -146,7 +146,7 @@ jobs:
146146
- uses: actions-rs/toolchain@v1
147147
with:
148148
profile: minimal
149-
toolchain: 1.64.0
149+
toolchain: 1.65.0
150150
target: aarch64-linux-android
151151
override: true
152152
- name: Set up cargo cache

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ NOTE: [`epaint`](crates/epaint/CHANGELOG.md), [`eframe`](crates/eframe/CHANGELOG
55

66

77
## Unreleased
8+
* MSRV (Minimum Supported Rust Version) is now `1.65.0` ([#2314](https://github.com/emilk/egui/pull/2314)).
89
* ⚠️ BREAKING: egui now expects integrations to do all color blending in gamma space ([#2071](https://github.com/emilk/egui/pull/2071)).
910
* ⚠️ BREAKING: if you have overlapping interactive widgets, only the top widget (last added) will be interactive ([#2244](https://github.com/emilk/egui/pull/2244)).
1011

Cranky.toml

+111-104
Original file line numberDiff line numberDiff line change
@@ -1,115 +1,122 @@
11
# https://github.com/ericseppanen/cargo-cranky
22
# cargo install cargo-cranky && cargo cranky
33

4-
deny = [
5-
"unsafe_code",
6-
]
4+
deny = ["unsafe_code"]
75

86
warn = [
9-
"clippy::all",
10-
"clippy::await_holding_lock",
11-
"clippy::char_lit_as_u8",
12-
"clippy::checked_conversions",
13-
"clippy::dbg_macro",
14-
"clippy::debug_assert_with_mut_call",
15-
"clippy::disallowed_methods",
16-
"clippy::disallowed_script_idents",
17-
"clippy::doc_markdown",
18-
"clippy::empty_enum",
19-
"clippy::enum_glob_use",
20-
"clippy::equatable_if_let",
21-
"clippy::exit",
22-
"clippy::expl_impl_clone_on_copy",
23-
"clippy::explicit_deref_methods",
24-
"clippy::explicit_into_iter_loop",
25-
"clippy::explicit_iter_loop",
26-
"clippy::fallible_impl_from",
27-
"clippy::filter_map_next",
28-
"clippy::flat_map_option",
29-
"clippy::float_cmp_const",
30-
"clippy::fn_params_excessive_bools",
31-
"clippy::fn_to_numeric_cast_any",
32-
"clippy::from_iter_instead_of_collect",
33-
"clippy::if_let_mutex",
34-
"clippy::implicit_clone",
35-
"clippy::imprecise_flops",
36-
"clippy::index_refutable_slice",
37-
"clippy::inefficient_to_string",
38-
"clippy::invalid_upcast_comparisons",
39-
"clippy::iter_not_returning_iterator",
40-
"clippy::large_digit_groups",
41-
"clippy::large_stack_arrays",
42-
"clippy::large_types_passed_by_value",
43-
"clippy::let_unit_value",
44-
"clippy::linkedlist",
45-
"clippy::lossy_float_literal",
46-
"clippy::macro_use_imports",
47-
"clippy::manual_assert",
48-
"clippy::manual_ok_or",
49-
"clippy::map_err_ignore",
50-
"clippy::map_flatten",
51-
"clippy::map_unwrap_or",
52-
"clippy::match_on_vec_items",
53-
"clippy::match_same_arms",
54-
"clippy::match_wild_err_arm",
55-
"clippy::match_wildcard_for_single_variants",
56-
"clippy::mem_forget",
57-
"clippy::mismatched_target_os",
58-
"clippy::missing_enforced_import_renames",
59-
"clippy::missing_errors_doc",
60-
"clippy::missing_safety_doc",
61-
"clippy::mut_mut",
62-
"clippy::mutex_integer",
63-
"clippy::needless_borrow",
64-
"clippy::needless_continue",
65-
"clippy::needless_for_each",
66-
"clippy::needless_pass_by_value",
67-
"clippy::negative_feature_names",
68-
"clippy::nonstandard_macro_braces",
69-
"clippy::option_option",
70-
"clippy::path_buf_push_overwrite",
71-
"clippy::ptr_as_ptr",
72-
"clippy::rc_mutex",
73-
"clippy::ref_option_ref",
74-
"clippy::rest_pat_in_fully_bound_structs",
75-
"clippy::same_functions_in_if_condition",
76-
"clippy::semicolon_if_nothing_returned",
77-
"clippy::single_match_else",
78-
"clippy::str_to_string",
79-
"clippy::string_add_assign",
80-
"clippy::string_add",
81-
"clippy::string_lit_as_bytes",
82-
"clippy::string_to_string",
83-
"clippy::todo",
84-
"clippy::trailing_empty_array",
85-
"clippy::trait_duplication_in_bounds",
86-
"clippy::unimplemented",
87-
"clippy::unnecessary_wraps",
88-
"clippy::unnested_or_patterns",
89-
"clippy::unused_self",
90-
"clippy::useless_transmute",
91-
"clippy::verbose_file_reads",
92-
"clippy::zero_sized_map_values",
93-
"elided_lifetimes_in_paths",
94-
"future_incompatible",
95-
"nonstandard_style",
96-
"rust_2018_idioms",
97-
"rust_2021_prelude_collisions",
98-
"rustdoc::missing_crate_level_docs",
99-
"semicolon_in_expressions_from_macros",
100-
"trivial_numeric_casts",
101-
"unused_extern_crates",
102-
"unused_import_braces",
103-
"unused_lifetimes",
104-
# "clippy::cloned_instead_of_copied",
105-
# "clippy::mod_module_files",
106-
# "trivial_casts",
107-
# "unused_qualifications",
7+
"clippy::all",
8+
"clippy::await_holding_lock",
9+
"clippy::bool_to_int_with_if",
10+
"clippy::char_lit_as_u8",
11+
"clippy::checked_conversions",
12+
"clippy::dbg_macro",
13+
"clippy::debug_assert_with_mut_call",
14+
"clippy::disallowed_methods",
15+
"clippy::disallowed_script_idents",
16+
"clippy::doc_link_with_quotes",
17+
"clippy::doc_markdown",
18+
"clippy::empty_enum",
19+
"clippy::enum_glob_use",
20+
"clippy::equatable_if_let",
21+
"clippy::exit",
22+
"clippy::expl_impl_clone_on_copy",
23+
"clippy::explicit_deref_methods",
24+
"clippy::explicit_into_iter_loop",
25+
"clippy::explicit_iter_loop",
26+
"clippy::fallible_impl_from",
27+
"clippy::filter_map_next",
28+
"clippy::flat_map_option",
29+
"clippy::float_cmp_const",
30+
"clippy::fn_params_excessive_bools",
31+
"clippy::fn_to_numeric_cast_any",
32+
"clippy::from_iter_instead_of_collect",
33+
"clippy::if_let_mutex",
34+
"clippy::implicit_clone",
35+
"clippy::imprecise_flops",
36+
"clippy::index_refutable_slice",
37+
"clippy::inefficient_to_string",
38+
"clippy::invalid_upcast_comparisons",
39+
"clippy::iter_not_returning_iterator",
40+
"clippy::iter_on_empty_collections",
41+
"clippy::iter_on_single_items",
42+
"clippy::large_digit_groups",
43+
"clippy::large_stack_arrays",
44+
"clippy::large_types_passed_by_value",
45+
"clippy::let_unit_value",
46+
"clippy::linkedlist",
47+
"clippy::lossy_float_literal",
48+
"clippy::macro_use_imports",
49+
"clippy::manual_assert",
50+
"clippy::manual_instant_elapsed",
51+
"clippy::manual_ok_or",
52+
"clippy::manual_string_new",
53+
"clippy::map_err_ignore",
54+
"clippy::map_flatten",
55+
"clippy::map_unwrap_or",
56+
"clippy::match_on_vec_items",
57+
"clippy::match_same_arms",
58+
"clippy::match_wild_err_arm",
59+
"clippy::match_wildcard_for_single_variants",
60+
"clippy::mem_forget",
61+
"clippy::mismatched_target_os",
62+
"clippy::mismatching_type_param_order",
63+
"clippy::missing_enforced_import_renames",
64+
"clippy::missing_errors_doc",
65+
"clippy::missing_safety_doc",
66+
"clippy::mut_mut",
67+
"clippy::mutex_integer",
68+
"clippy::needless_borrow",
69+
"clippy::needless_continue",
70+
"clippy::needless_for_each",
71+
"clippy::needless_pass_by_value",
72+
"clippy::negative_feature_names",
73+
"clippy::nonstandard_macro_braces",
74+
"clippy::option_option",
75+
"clippy::path_buf_push_overwrite",
76+
"clippy::ptr_as_ptr",
77+
"clippy::rc_mutex",
78+
"clippy::ref_option_ref",
79+
"clippy::rest_pat_in_fully_bound_structs",
80+
"clippy::same_functions_in_if_condition",
81+
"clippy::semicolon_if_nothing_returned",
82+
"clippy::single_match_else",
83+
"clippy::str_to_string",
84+
"clippy::string_add_assign",
85+
"clippy::string_add",
86+
"clippy::string_lit_as_bytes",
87+
"clippy::string_to_string",
88+
"clippy::todo",
89+
"clippy::trailing_empty_array",
90+
"clippy::trait_duplication_in_bounds",
91+
"clippy::unimplemented",
92+
"clippy::unnecessary_wraps",
93+
"clippy::unnested_or_patterns",
94+
"clippy::unused_peekable",
95+
"clippy::unused_rounding",
96+
"clippy::unused_self",
97+
"clippy::useless_transmute",
98+
"clippy::verbose_file_reads",
99+
"clippy::zero_sized_map_values",
100+
"elided_lifetimes_in_paths",
101+
"future_incompatible",
102+
"nonstandard_style",
103+
"rust_2018_idioms",
104+
"rust_2021_prelude_collisions",
105+
"rustdoc::missing_crate_level_docs",
106+
"semicolon_in_expressions_from_macros",
107+
"trivial_numeric_casts",
108+
"unused_extern_crates",
109+
"unused_import_braces",
110+
"unused_lifetimes",
108111
]
109112

110113
allow = [
114+
# TODO(emilk): enable more lints
115+
"clippy::cloned_instead_of_copied",
111116
"clippy::derive_partial_eq_without_eq",
112117
"clippy::type_complexity",
113-
"clippy::unnecessary_lazy_evaluations",
114-
"clippy::let-and-return"
118+
"clippy::undocumented_unsafe_blocks",
119+
"trivial_casts",
120+
"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
121+
"unused_qualifications",
115122
]

crates/eframe/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ NOTE: [`egui-winit`](../egui-winit/CHANGELOG.md), [`egui_glium`](../egui_glium/C
55

66

77
## Unreleased
8+
* MSRV (Minimum Supported Rust Version) is now `1.65.0` ([#2314](https://github.com/emilk/egui/pull/2314)).
89
* Added `NativeOptions::fullsize_content` option on Mac to build titlebar-less windows with floating window controls ([#2049](https://github.com/emilk/egui/pull/2049)).
910
* Added `NativeOptions::event_loop_builder` hook for apps to change platform specific event loop options ([#1952](https://github.com/emilk/egui/pull/1952)).
1011
* Enabled deferred render state initialization to support Android ([#1952](https://github.com/emilk/egui/pull/1952)).

crates/eframe/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.19.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.62"
7+
rust-version = "1.65"
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/epi_integration.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ pub fn handle_app_output(
165165
}
166166

167167
if let Some(fullscreen) = fullscreen {
168-
window.set_fullscreen(fullscreen.then(|| winit::window::Fullscreen::Borderless(None)));
168+
window.set_fullscreen(fullscreen.then_some(winit::window::Fullscreen::Borderless(None)));
169169
}
170170

171171
if let Some(window_title) = window_title {
@@ -328,7 +328,7 @@ impl EpiIntegration {
328328
handle_app_output(window, self.egui_ctx.pixels_per_point(), app_output);
329329
}
330330

331-
let frame_time = (std::time::Instant::now() - frame_start).as_secs_f64() as f32;
331+
let frame_time = frame_start.elapsed().as_secs_f64() as f32;
332332
self.frame.info.cpu_usage = Some(frame_time);
333333

334334
full_output

crates/eframe/src/web/events.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ pub fn install_canvas_events(runner_container: &mut AppRunnerContainer) -> Resul
308308
modifiers,
309309
});
310310

311-
push_touches(&mut *runner_lock, egui::TouchPhase::Start, &event);
311+
push_touches(&mut runner_lock, egui::TouchPhase::Start, &event);
312312
runner_lock.needs_repaint.repaint_asap();
313313
event.stop_propagation();
314314
event.prevent_default();
@@ -330,7 +330,7 @@ pub fn install_canvas_events(runner_container: &mut AppRunnerContainer) -> Resul
330330
.events
331331
.push(egui::Event::PointerMoved(pos));
332332

333-
push_touches(&mut *runner_lock, egui::TouchPhase::Move, &event);
333+
push_touches(&mut runner_lock, egui::TouchPhase::Move, &event);
334334
runner_lock.needs_repaint.repaint_asap();
335335
event.stop_propagation();
336336
event.prevent_default();
@@ -357,7 +357,7 @@ pub fn install_canvas_events(runner_container: &mut AppRunnerContainer) -> Resul
357357
// Then remove hover effect:
358358
runner_lock.input.raw.events.push(egui::Event::PointerGone);
359359

360-
push_touches(&mut *runner_lock, egui::TouchPhase::End, &event);
360+
push_touches(&mut runner_lock, egui::TouchPhase::End, &event);
361361
runner_lock.needs_repaint.repaint_asap();
362362
event.stop_propagation();
363363
event.prevent_default();

crates/egui-wgpu/Cargo.toml

+1-1
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.62"
11+
rust-version = "1.65"
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/winit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl Painter {
4646
Self {
4747
configuration,
4848
msaa_samples,
49-
depth_format: (depth_bits > 0).then(|| wgpu::TextureFormat::Depth32Float),
49+
depth_format: (depth_bits > 0).then_some(wgpu::TextureFormat::Depth32Float),
5050
depth_texture_view: None,
5151

5252
instance,

crates/egui-winit/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.19.0"
44
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
55
description = "Bindings for using egui with winit"
66
edition = "2021"
7-
rust-version = "1.62"
7+
rust-version = "1.65"
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-winit/src/window_settings.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ impl WindowSettings {
6868
})
6969
.with_fullscreen(
7070
self.fullscreen
71-
.then(|| winit::window::Fullscreen::Borderless(None)),
71+
.then_some(winit::window::Fullscreen::Borderless(None)),
7272
)
7373
} else {
7474
window

crates/egui/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.19.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.62"
7+
rust-version = "1.65"
88
homepage = "https://github.com/emilk/egui"
99
license = "MIT OR Apache-2.0"
1010
readme = "../../README.md"

crates/egui/src/memory.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ impl Focus {
293293
self.id_next_frame = self.last_interested; // frame-delay so gained_focus works
294294
self.pressed_shift_tab = false;
295295
}
296-
} else if self.pressed_tab && self.id == None && !self.give_to_next {
296+
} else if self.pressed_tab && self.id.is_none() && !self.give_to_next {
297297
// nothing has focus and the user pressed tab - give focus to the first widgets that wants it:
298298
self.id = Some(id);
299299
self.pressed_tab = false;

0 commit comments

Comments
 (0)