mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-21 06:50:59 +01:00
Allow if/panic in wgpu-hal
This commit is contained in:
1 parent
075da23d0d
commit
97d6db4d18
3 files changed
+8
-3
No files matched your search
@@ -145,6 +145,7 @@ impl Test<'_> {
|
||||
.collect::<Vec<u8>>(),
|
||||
};
|
||||
|
||||
#[allow(unknown_lints, clippy::if_then_panic)]
|
||||
if &expected_data[..] != contents {
|
||||
panic!(
|
||||
"Test expectation is not met!\nBuffer content was:\n{:?}\nbut expected:\n{:?}",
|
||||
|
||||
@@ -413,13 +413,13 @@ impl<A: HalApi> Device<A> {
|
||||
&'this mut self,
|
||||
hub: &Hub<A, G>,
|
||||
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<A: HalApi> Device<A> {
|
||||
}
|
||||
}
|
||||
|
||||
self.lock_life(&mut token)
|
||||
self.lock_life(token)
|
||||
.suspected_resources
|
||||
.extend(&self.temp_suspected);
|
||||
|
||||
|
||||
@@ -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,
|
||||
)]
|
||||
|
||||
Reference in new issue
Block a user