rust-lang / rust-lang/reference
Document how extending int-to-ptr and ptr-to-int casts work
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.6k
- Forks
- 607
- PR merge metrics
- PR metrics pending
Description
Judging by the behaviour of Rust in this playground, these casts are treated the same as int-to-int casts, where the pointer is considered equivalent to usize. Casting i32 to usize will sign extend, casting usize to i128 will zero extend.
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 that documents integer and pointer casts, then compare its current wording with the linked Rust playground behavior. Document how int-to-ptr and ptr-to-int casts follow integer-cast extension rules, including sign extension from signed integers and zero extension from usize. Done means the Reference clearly states these rules.
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
- Mostly clear
- Newbie friendliness
- 50/100