Overflow from integer negation expressions
Nobody has claimed this yet.
- Dominant language
- reStructuredText
- Stars
- 497
- Forks
- 41
- Avg merge
- 3h 52m
- Merged PRs (30d)
- 4
Description
§6.5.4:18 (fls_CutpaCFCGHQs) includes:
If the result of the negation expression does not fit within the range of the operand type, then arithmetic overflow occurs.
There is an exception which needs to be documented here: arithmetic overflow doesn't occur in some cases where the operand includes a literal and the value of the expression would fit in the type (eg -128_u8 or -(128_u8)).
See rust-lang/reference#1188 for how this was addressed there.
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
Read §6.5.4:18 and the linked rust-lang/reference#1188 discussion first. Update the negation-overflow documentation to cover literal operands such as -128_u8 and -(128_u8), and consider the wording complete when the exception and its examples are accurately stated.
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
- 68/100