ignore 'arc instead of rc' warnings on wasm

This commit is contained in:
Andreas Reich 2024-08-10 12:36:04 +02:00
parent 24498f04d4
commit 1bfe8845d5
2 changed files with 7 additions and 1 deletions

View File

@ -495,7 +495,6 @@ impl Global {
surface_per_backend,
};
#[allow(clippy::arc_with_non_send_sync)]
let id = self
.surfaces
.prepare(wgt::Backend::Empty, id_in) // No specific backend for Surface, since it's not specific.

View File

@ -62,6 +62,13 @@ the documentation for `wgpu-core` is empty unless built with
unused_extern_crates,
unused_qualifications
)]
// We use `Arc` in wgpu-core, but on wasm (unless opted out via `fragile-send-sync-non-atomic-wasm`)
// wgpu-hal resources are not Send/Sync, causing a clippy warning for unnecessary `Arc`s.
// We could use `Rc`s in this case as recommended, but unless atomics are enabled
// this doesn't make a difference.
// Therefore, this is only really a concern for users targeting WebGL
// (the only reason to use wgpu-core on the web in the first place) that have atomics enabled.
#![cfg_attr(not(send_sync), allow(clippy::arc_with_non_send_sync))]
pub mod binding_model;
pub mod command;