wrapping_$op() and saturating_$op() should be #[must_use] #59787
Labels
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
I just had a bug due to a
wrapping_add()
having no effect because the return value was ignored:It's an easy mistake to make when rewriting
foo.x += bar
to handle overflow.EDIT: (I didn't do enough searching before opening this issue)
On one hand this is a subset of #48926, and covers a lot of methods so RFC #2450 would be better. On the other hand this issue is a v2 of #50124 for the parts of it not covered by #50149.
Meta
The text was updated successfully, but these errors were encountered: