rust-lang / rust-lang/reference
Panicking while dropping lvalue of assignment
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.6k
- Forks
- 607
- PR merge metrics
- PR metrics pending
Description
Currently the references states that in *x = v, the value contained in x is first dropped before being replaced by v. If that where strictly the case, if the drop panics and that panic is caught, we could then observe an uninitialized x.
Indeed in practice, the generated clean up code moves v into x when unwinding, but this should likely be documented.
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
Start by locating the Rust Reference section covering assignment and drop behavior, then verify the unwinding behavior described in the issue. Update the documentation to explain what happens when dropping the previous value panics and confirm that the resulting behavior is no longer described as exposing an uninitialized place.
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