rust-lang / rust-lang/rust

Make `std::env::{Args, ArgsOs}` `Send` and `Sync`

Open
#118,700 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-feature-request T-libs
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

#48004 requests to make these 2 types !Send and !Sync and #48005 implements it.

From this comment, at that time, they were really not Send and Sync, but now, it seems both Unix and Wndows are defining Args as:

struct Args {
     args: vec::IntoIter<OsString>
}

which has no reason to be !Send and !Sync, I am not sure about that cloudabi platform though given that I didn't find it in the source code.

If the Std allocates for these types on all the platforms(i.e., basically a Vec<OsString>), we can probably make them Send and Sync

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 tracing the std::env::{Args, ArgsOs} definitions for Unix and Windows, then investigate the cloudabi implementation mentioned in the issue. Done means confirming whether these types can be Send and Sync on every supported platform and updating the relevant standard-library behavior accordingly.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.