Skip to content

Feature request: Make Mutex::new/RwLock::new const. #73714

Closed
@emilio

Description

@emilio

This is useful for the same reason Mutex::new being const is (#66806).

Right now RwLock::new allocates, which is unfortunate.

The parking_lot crate does this: https://amanieu.github.io/parking_lot/parking_lot/struct.RwLock.html#methods

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)C-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions