`std::env::{set_var, remove_var}` is called in tests without safety documentation
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Introduced by @ehuss in #136983 (36733f3bce9102647e8adf9d9a89cabcee9c4cdf, ef20a1b1f8c6dcbeb05da86634ca4516677a31b0), apparently without double-checking whether these functions were actually safe to call.
Found when trying to audit whether this repository's calls to these unsafe environment variable functions were safe. It doesn't appear to be the case to me, e.g.
The last example is even in user-facing documentation.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the calls in library/test/src/term/terminfo/searcher/tests.rs, library/std/src/process/tests.rs, and library/std/src/env.rs, starting with the cited lines and the safety requirements for environment-variable operations. Audit the surrounding tests and user-facing documentation, then verify that each affected call has an appropriate safety explanation or is otherwise addressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation, operating-systems, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100