Skip to content

Remove dependency on once_cell #6379

Open
@jimblandy

Description

@jimblandy

Much of the once_cell crate's API has now been added to std, so ideally we could remove this dependency. This is blocked on std::sync::OnceLock::get_or_try_init being stabilized:

As the once_cell author commented:

@jimblandy FWIW, if you are not using portable atomic, then probably you don't actually need once_cell crate. Most of the API is now available in std (but not in core), so I am thinking that the primary role of once_cell for the ecosystem right now is exactly to serve as a poly-fill for no-std use-cases.

At the moment, wgpu_core::pool::ResourcePool uses once_cell::sync::OnceCell::get_or_try_init, whose std analog, std::sync::OnceLock::get_or_try_init, is not yet stable.


PRs:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions