about summary refs log tree commit diff
path: root/src/rustllvm/PassWrapper.cpp
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-01-07 02:36:01 +0800
committerGitHub <noreply@github.com>2018-01-07 02:36:01 +0800
commitd9d5c667d819ce400fc7adb09dcd6482b0aa519e (patch)
treea8744dbcd1b848017387e82cfd161d9fa3d576c4 /src/rustllvm/PassWrapper.cpp
parent72176cf96cb79a0ebf62972b76dbe68c933bef4d (diff)
parentf2c5472ed5dd2b38711375c469c54536e51e9cf3 (diff)
downloadrust-d9d5c667d819ce400fc7adb09dcd6482b0aa519e.tar.gz
rust-d9d5c667d819ce400fc7adb09dcd6482b0aa519e.zip
Rollup merge of #46947 - tspiteri:checked-div-rem-none, r=frewsxcv
doc: improve None condition doc for `checked_div` and `checked_rem`

This commit improves the condition mentioned in the docs for which `checked_div` and `checked_rem` return `None`.

For signed division, the commit changes "the operation results in overflow" to "the division results in overflow", otherwise there is room for misinterpretation for `checked_rem`: Without considering overflow, `MIN % -1` would be simply zero, allowing the misinterpretation that "the operation" does not result in overflow in this case. This ambiguity is removed using "when the division results in overflow".

For unsigned division, the condition for `None` should be simply when `rhs == 0`, as no other overflow is possible.
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions