diff --git a/player/tests/test.rs b/player/tests/test.rs index cfecb57d7..0c5532bf2 100644 --- a/player/tests/test.rs +++ b/player/tests/test.rs @@ -145,6 +145,7 @@ impl Test<'_> { .collect::>(), }; + #[allow(unknown_lints, clippy::if_then_panic)] if &expected_data[..] != contents { panic!( "Test expectation is not met!\nBuffer content was:\n{:?}\nbut expected:\n{:?}", diff --git a/wgpu-core/src/device/mod.rs b/wgpu-core/src/device/mod.rs index 36a59400f..858d79cb6 100644 --- a/wgpu-core/src/device/mod.rs +++ b/wgpu-core/src/device/mod.rs @@ -413,13 +413,13 @@ impl Device { &'this mut self, hub: &Hub, trackers: &TrackerSet, - mut token: &mut Token<'token, Self>, + token: &mut Token<'token, Self>, ) { self.temp_suspected.clear(); // As the tracker is cleared/dropped, we need to consider all the resources // that it references for destruction in the next GC pass. { - let (bind_group_guard, mut token) = hub.bind_groups.read(&mut token); + let (bind_group_guard, mut token) = hub.bind_groups.read(token); let (compute_pipe_guard, mut token) = hub.compute_pipelines.read(&mut token); let (render_pipe_guard, mut token) = hub.render_pipelines.read(&mut token); let (query_set_guard, mut token) = hub.query_sets.read(&mut token); @@ -470,7 +470,7 @@ impl Device { } } - self.lock_life(&mut token) + self.lock_life(token) .suspected_resources .extend(&self.temp_suspected); diff --git a/wgpu-hal/src/lib.rs b/wgpu-hal/src/lib.rs index d776b85d6..5eda0973e 100644 --- a/wgpu-hal/src/lib.rs +++ b/wgpu-hal/src/lib.rs @@ -15,6 +15,8 @@ */ #![allow( + // for `if_then_panic` until it reaches stable + unknown_lints, // We use loops for getting early-out of scope without closures. clippy::never_loop, // We don't use syntax sugar where it's not necessary. @@ -29,6 +31,8 @@ clippy::single_match, // Push commands are more regular than macros. clippy::vec_init_then_push, + // "if panic" is a good uniform construct. + clippy::if_then_panic, // TODO! clippy::missing_safety_doc, )]