RefCell needs more explanation: heap or stack?
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 18.3k
- Forks
- 4.1k
- Avg merge
- 14m
- Merged PRs (30d)
- 1
Description
The RefCell chapter gives the reader an impression that RefCell is no different from Box other than the additional support of runtime mutability check. However there's another big difference: Box manages object on the heap while RefCell is just a stack variable wrapper. I think this needs to be clearly stated when introducing RefCell to the reader, otherwise it can cause confusions (see this discussion in the forum).
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 with the linked RefCell chapter in The Rust Programming Language and review how RefCell is compared with Box. Update the explanation to clearly distinguish RefCell's runtime mutability checks from Box's heap allocation, so readers understand the difference and the chapter addresses the reported confusion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100