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: