about summary refs log tree commit diff
path: root/src/libcore/num
diff options
context:
space:
mode:
authorThomas Winwood <twwinwood@gmail.com>2016-02-10 11:36:10 +0000
committerThomas Winwood <twwinwood@gmail.com>2016-02-10 11:36:10 +0000
commit8d5dcf9ce5425511720e77153aab665a7850f85a (patch)
tree2d02d846d481c37954b55c7b833d61d373fca482 /src/libcore/num
parent523fa1331eda875136d3a980a5d51c7706f23f30 (diff)
downloadrust-8d5dcf9ce5425511720e77153aab665a7850f85a.tar.gz
rust-8d5dcf9ce5425511720e77153aab665a7850f85a.zip
Note rotate_{left,right} in wrapping_sh{lr} docs
Diffstat (limited to 'src/libcore/num')
-rw-r--r--src/libcore/num/mod.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs
index 9a9dfaa2679..d094f05374b 100644
--- a/src/libcore/num/mod.rs
+++ b/src/libcore/num/mod.rs
@@ -741,6 +741,13 @@ macro_rules! int_impl {
         /// where `mask` removes any high-order bits of `rhs` that
         /// would cause the shift to exceed the bitwidth of the type.
         ///
+        /// Note that this is *not* the same as a rotate-left; the
+        /// RHS of a wrapping shift-left is restricted to the range
+        /// of the type, rather than the bits shifted out of the LHS
+        /// being returned to the other end. The primitive integer
+        /// types all implement a `rotate_left` function, which may
+        /// be what you want instead.
+        ///
         /// # Examples
         ///
         /// Basic usage:
@@ -759,6 +766,13 @@ macro_rules! int_impl {
         /// where `mask` removes any high-order bits of `rhs` that
         /// would cause the shift to exceed the bitwidth of the type.
         ///
+        /// Note that this is *not* the same as a rotate-right; the
+        /// RHS of a wrapping shift-right is restricted to the range
+        /// of the type, rather than the bits shifted out of the LHS
+        /// being returned to the other end. The primitive integer
+        /// types all implement a `rotate_right` function, which may
+        /// be what you want instead.
+        ///
         /// # Examples
         ///
         /// Basic usage: