rust-lang / rust-lang/rust

Edition 2027: Consider replacing `std::sync::Mutex` and other locks with `std::sync::nonpoison` versions

Open
#149,359 40 comments 47 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-maybe-future-edition C-discussion T-libs
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

View all comments

This serves as a place to discuss changing default lock types to their nonpoison versions, which has come up a number of times before but not yet (to my knowledge) discussed in depth.

@davepacheco brings up a good point at https://github.com/rust-lang/rust/issues/134645#issuecomment-3583159102 that having posioning locks tends to be a safer default, and that the .unwrap() annoyance could be smoothed with panicking methods rather than changing out the type.

I'm not sure whether or not an RFC would be required but considering the impact, it doesn't seem like a bad idea (see also https://github.com/rust-lang/rfcs/pull/3550 for a similar change, though that involved lang).

Related:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the related tracking issues 134645 and 134646, then review the discussion linked from issue 134645 and RFC pull request 3550 for prior context. The payload names no implementation files or tests; the work is done only after the project reaches and documents a decision on whether to pursue the lock-type change and whether an RFC is required.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.