Skip to content

Arc and not Send / Sync #344

@waywardmonkeys

Description

@waywardmonkeys

Clippy reports 4 instances of this:

warning: usage of an `Arc` that is not `Send` and `Sync`
    --> src/lib.rs:2738:37
     |
2738 |               temp[i] = Arc::into_raw(Arc::new(WGPUAdapterImpl {
     |  _____________________________________^
2739 | |                 context: context.clone(),
2740 | |                 id: *id,
2741 | |                 properties: OnceCell::default(),
2742 | |             }));
     | |______________^
     |
     = note: `Arc<WGPUAdapterImpl>` is not `Send` and `Sync` as:
     = note: - the trait `Sync` is not implemented for `WGPUAdapterImpl`
     = help: consider using an `Rc` instead. `Arc` does not provide benefits for non `Send` and `Sync` types
     = note: if you intend to use `Arc` with `Send` and `Sync` traits
     = note: wrap the inner type with a `Mutex` or implement `Send` and `Sync` for `WGPUAdapterImpl`
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync

The other types are: WGPUBufferImpl and WGPURenderBundleEncoderImpl.

Not sure what the right fix for this in context, but if there's a good suggestion, I'm happy to submit a PR for it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions