rust-lang / rust-lang/std-dev-guide

Document what we do about unwinding and leaks

Open
#22 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
90
Forks
47
Avg merge
9h 22m
Merged PRs (30d)
1

Description

In https://github.com/rust-lang/rust/pull/67290 we added drop guards to collections that will attempt to continue dropping in case dropping an item unwinds. That means collections will either not leak if an item unwinds during drop, or will abort.

In https://github.com/rust-lang/rust/pull/75644 we've looked at preventing leaks if an unwind happens partway through initializing a MaybeUninit (usually for arrays).

We should come up with some concrete guidance on how we want to deal with leaks and unwinding

Contributor guide

No contributing guide indexed for this repository

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 rust-lang/rust PRs 67290 and 75644, which cover drop guards for collections and leaks during partial MaybeUninit initialization. Use those examples to identify the concrete unwinding and leak guidance needed for standard library developers. Done means documenting an agreed approach, including when collections should continue dropping and when aborting is acceptable.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Documentation
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.