Skip to content

Commit 328422d

Browse files
authored
Update MSRV to Rust 1.79 (emilk#5421)
Mostly to fix `cargo-machete` CI
1 parent 7e3275c commit 328422d

File tree

50 files changed

+94
-103
lines changed

Some content is hidden

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

50 files changed

+94
-103
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.77.0
42+
toolchain: 1.79.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.77.0
21+
toolchain: 1.79.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.77.0
86+
toolchain: 1.79.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.77.0"
158+
rust-version: "1.79.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.77.0
173+
toolchain: 1.79.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.77.0
192+
toolchain: 1.79.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.77.0
211+
toolchain: 1.79.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.77.0
235+
toolchain: 1.79.0
236236

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

Cargo.toml

Lines changed: 14 additions & 2 deletions
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.77"
26+
rust-version = "1.79"
2727
version = "0.29.1"
2828

2929

@@ -145,6 +145,7 @@ disallowed_types = "warn" # See clippy.toml
145145
doc_link_with_quotes = "warn"
146146
doc_markdown = "warn"
147147
empty_enum = "warn"
148+
empty_enum_variants_with_brackets = "warn"
148149
enum_glob_use = "warn"
149150
equatable_if_let = "warn"
150151
exit = "warn"
@@ -169,6 +170,8 @@ inefficient_to_string = "warn"
169170
infinite_loop = "warn"
170171
into_iter_without_iter = "warn"
171172
invalid_upcast_comparisons = "warn"
173+
iter_filter_is_ok = "warn"
174+
iter_filter_is_some = "warn"
172175
iter_not_returning_iterator = "warn"
173176
iter_on_empty_collections = "warn"
174177
iter_on_single_items = "warn"
@@ -185,6 +188,7 @@ macro_use_imports = "warn"
185188
manual_assert = "warn"
186189
manual_clamp = "warn"
187190
manual_instant_elapsed = "warn"
191+
manual_is_variant_and = "warn"
188192
manual_let_else = "warn"
189193
manual_ok_or = "warn"
190194
manual_string_new = "warn"
@@ -202,6 +206,7 @@ mismatching_type_param_order = "warn"
202206
missing_enforced_import_renames = "warn"
203207
missing_errors_doc = "warn"
204208
missing_safety_doc = "warn"
209+
mixed_attributes_style = "warn"
205210
mut_mut = "warn"
206211
mutex_integer = "warn"
207212
needless_borrow = "warn"
@@ -211,21 +216,25 @@ needless_pass_by_ref_mut = "warn"
211216
needless_pass_by_value = "warn"
212217
negative_feature_names = "warn"
213218
nonstandard_macro_braces = "warn"
219+
option_as_ref_cloned = "warn"
214220
option_option = "warn"
215221
path_buf_push_overwrite = "warn"
216222
print_stderr = "warn"
217223
ptr_as_ptr = "warn"
218224
ptr_cast_constness = "warn"
225+
pub_underscore_fields = "warn"
219226
pub_without_shorthand = "warn"
220227
rc_mutex = "warn"
221228
readonly_write_lock = "warn"
222229
redundant_type_annotations = "warn"
230+
ref_as_ptr = "warn"
223231
ref_option_ref = "warn"
224232
ref_patterns = "warn"
225233
rest_pat_in_fully_bound_structs = "warn"
226234
same_functions_in_if_condition = "warn"
227235
semicolon_if_nothing_returned = "warn"
228236
single_match_else = "warn"
237+
str_split_at_newline = "warn"
229238
str_to_string = "warn"
230239
string_add = "warn"
231240
string_add_assign = "warn"
@@ -261,12 +270,15 @@ zero_sized_map_values = "warn"
261270

262271
# TODO(emilk): enable more of these lints:
263272
iter_over_hash_type = "allow"
264-
let_underscore_untyped = "allow"
265273
missing_assert_message = "allow"
266274
should_panic_without_expect = "allow"
267275
too_many_lines = "allow"
268276
unwrap_used = "allow" # TODO(emilk): We really wanna warn on this one
269277

278+
# These are meh:
279+
assigning_clones = "allow" # No please
280+
let_underscore_must_use = "allow"
281+
let_underscore_untyped = "allow"
270282
manual_range_contains = "allow" # this one is just worse imho
271283
self_named_module_files = "allow" # Disabled waiting on https://github.com/rust-lang/rust-clippy/issues/9602
272284
significant_drop_tightening = "allow" # Too many false positives

clippy.toml

Lines changed: 5 additions & 2 deletions
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.77"
6+
msrv = "1.79"
77

88
allow-unwrap-in-tests = true
99

@@ -69,9 +69,12 @@ disallowed-types = [
6969

7070
# Allow-list of words for markdown in docstrings https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
7171
doc-valid-idents = [
72-
# You must also update the same list in the root `clippy.toml`!
72+
# You must also update the same list in `scripts/clippy_wasm/clippy.toml`!
7373
"AccessKit",
7474
"WebGL",
75+
"WebGL1",
76+
"WebGL2",
7577
"WebGPU",
78+
"VirtualBox",
7679
"..",
7780
]

crates/eframe/src/epi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ pub struct WebOptions {
439439
/// Unused by webgl context as of writing.
440440
pub depth_buffer: u8,
441441

442-
/// Which version of WebGl context to select
442+
/// Which version of WebGL context to select
443443
///
444444
/// Default: [`WebGlContextOption::BestFirst`].
445445
#[cfg(feature = "glow")]

crates/eframe/src/native/event_loop_context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ impl EventLoopGuard {
1414
cell.get().is_none(),
1515
"Attempted to set a new event loop while one is already set"
1616
);
17-
cell.set(Some(event_loop as *const ActiveEventLoop));
17+
cell.set(Some(std::ptr::from_ref::<ActiveEventLoop>(event_loop)));
1818
});
1919
Self
2020
}

crates/eframe/src/web/web_painter_wgpu.rs

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,13 @@
1-
use raw_window_handle::{
2-
DisplayHandle, HandleError, HasDisplayHandle, HasWindowHandle, RawDisplayHandle,
3-
RawWindowHandle, WebDisplayHandle, WebWindowHandle, WindowHandle,
4-
};
51
use std::sync::Arc;
2+
63
use wasm_bindgen::JsValue;
74
use web_sys::HtmlCanvasElement;
85

9-
use crate::WebOptions;
106
use egui_wgpu::{RenderState, SurfaceErrorAction, WgpuSetup};
117

12-
use super::web_painter::WebPainter;
13-
14-
struct EguiWebWindow(u32);
15-
16-
#[allow(unsafe_code)]
17-
impl HasWindowHandle for EguiWebWindow {
18-
fn window_handle(&self) -> Result<WindowHandle<'_>, HandleError> {
19-
// SAFETY: there is no lifetime here.
20-
unsafe {
21-
Ok(WindowHandle::borrow_raw(RawWindowHandle::Web(
22-
WebWindowHandle::new(self.0),
23-
)))
24-
}
25-
}
26-
}
8+
use crate::WebOptions;
279

28-
#[allow(unsafe_code)]
29-
impl HasDisplayHandle for EguiWebWindow {
30-
fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError> {
31-
// SAFETY: there is no lifetime here.
32-
unsafe {
33-
Ok(DisplayHandle::borrow_raw(RawDisplayHandle::Web(
34-
WebDisplayHandle::new(),
35-
)))
36-
}
37-
}
38-
}
10+
use super::web_painter::WebPainter;
3911

4012
pub(crate) struct WebPainterWgpu {
4113
canvas: HtmlCanvasElement,

crates/eframe/src/web/web_runner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub struct WebRunner {
1616
/// Have we ever panicked?
1717
panic_handler: PanicHandler,
1818

19-
/// If we ever panic during running, this RefCell is poisoned.
19+
/// If we ever panic during running, this `RefCell` is poisoned.
2020
/// So before we use it, we need to check [`Self::panic_handler`].
2121
runner: Rc<RefCell<Option<AppRunner>>>,
2222

crates/egui-wgpu/src/renderer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ pub struct ScreenDescriptor {
125125
/// Size of the window in physical pixels.
126126
pub size_in_pixels: [u32; 2],
127127

128-
/// HiDPI scale factor (pixels per point).
128+
/// High-DPI scale factor (pixels per point).
129129
pub pixels_per_point: f32,
130130
}
131131

crates/egui/src/containers/scroll_area.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ pub struct State {
3939
scroll_start_offset_from_top_left: [Option<f32>; 2],
4040

4141
/// Is the scroll sticky. This is true while scroll handle is in the end position
42-
/// and remains that way until the user moves the scroll_handle. Once unstuck (false)
42+
/// and remains that way until the user moves the `scroll_handle`. Once unstuck (false)
4343
/// it remains false until the scroll touches the end position, which reenables stickiness.
4444
scroll_stuck_to_end: Vec2b,
4545

0 commit comments

Comments
 (0)