From 8d5dcf9ce5425511720e77153aab665a7850f85a Mon Sep 17 00:00:00 2001 From: Thomas Winwood Date: Wed, 10 Feb 2016 11:36:10 +0000 Subject: [PATCH] Note rotate_{left,right} in wrapping_sh{lr} docs --- src/libcore/num/mod.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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: