]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #31535 - Ketsuban:more-detail-in-wrapping-shift-documentation, r...
authorManish Goregaokar <manishsmail@gmail.com>
Sat, 13 Feb 2016 22:29:09 +0000 (03:59 +0530)
committerManish Goregaokar <manishsmail@gmail.com>
Sat, 13 Feb 2016 23:36:32 +0000 (05:06 +0530)
commit3c845fe8694d39818a4f921cfada39bacfb91804
tree062d853388828a2a6969f2c48d6d284e841d3941
parent6e446532e835ed3c934eec5a98bb795c0ffd4e50
parent8d5dcf9ce5425511720e77153aab665a7850f85a
Rollup merge of #31535 - Ketsuban:more-detail-in-wrapping-shift-documentation, r=steveklabnik

`wrapping_shl` and `wrapping_shr` are easy to mistake for rotations, when in fact they work somewhat differently. The documentation currently available is a little sparse and easy to misinterpret, so I've added a warning to anyone who bumps into them that the equivalent rotate methods may actually be what they're looking for.

If it's deemed useful to add a symmetrical mention to the documentation for the `rotate_left` and `rotate_right` methods, I can certainly have a go at that, but my gut feeling is that people likely to want a rotate will already know about the wrapping-arithmetic methods, for example from writing CPU simulators.