@@ -275,6 +275,10 @@ macro_rules! int_impl {
275275 /// Shifts the bits to the left by a specified amount, `n`,
276276 /// wrapping the truncated bits to the end of the resulting integer.
277277 ///
278+ /// `rotate_left(n)` is equivalent to applying `rotate_left(1)` a total of `n` times. In
279+ /// particular, a rotation by the number of bits in `self` returns the input value
280+ /// unchanged.
281+ ///
278282 /// Please note this isn't the same operation as the `<<` shifting operator!
279283 ///
280284 /// # Examples
@@ -284,6 +288,7 @@ macro_rules! int_impl {
284288 #[ doc = concat!( "let m = " , $rot_result, ";" ) ]
285289 ///
286290 #[ doc = concat!( "assert_eq!(n.rotate_left(" , $rot, "), m);" ) ]
291+ #[ doc = concat!( "assert_eq!(n.rotate_left(1024), n);" ) ]
287292 /// ```
288293 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
289294 #[ rustc_const_stable( feature = "const_int_methods" , since = "1.32.0" ) ]
@@ -298,6 +303,10 @@ macro_rules! int_impl {
298303 /// wrapping the truncated bits to the beginning of the resulting
299304 /// integer.
300305 ///
306+ /// `rotate_right(n)` is equivalent to applying `rotate_right(1)` a total of `n` times. In
307+ /// particular, a rotation by the number of bits in `self` returns the input value
308+ /// unchanged.
309+ ///
301310 /// Please note this isn't the same operation as the `>>` shifting operator!
302311 ///
303312 /// # Examples
@@ -307,6 +316,7 @@ macro_rules! int_impl {
307316 #[ doc = concat!( "let m = " , $rot_op, ";" ) ]
308317 ///
309318 #[ doc = concat!( "assert_eq!(n.rotate_right(" , $rot, "), m);" ) ]
319+ #[ doc = concat!( "assert_eq!(n.rotate_right(1024), n);" ) ]
310320 /// ```
311321 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
312322 #[ rustc_const_stable( feature = "const_int_methods" , since = "1.32.0" ) ]
0 commit comments