title: Is it expected that a too large bitshift is undefined behavior in Rust?
body: <p>When you run this code:</p>
  
  <pre><code>#![allow(exceeding_bitshifts)]
  
  fn main() {
      const NUMBER: u64 = 0b_10101010;
  
      fn print_shift(i: u32) {
          println!("{:b}", NUMBER &gt;&gt; i);
      }
  
      print_shift(65);
      println!("{:b}", NUMBER &gt;&gt; 65);
  }
  </code></pre>
  
  <p>You see that shifting the bits of a number with a value that exceed the bit length produces different behavior when doing at compile time or runtime.</p>
  
  <p>Is it a normal behavior? Is it documented somewhere? This is not in the <a href="https://doc.rust-lang.org/beta/reference/behavior-considered-undefined.html" rel="nofollow noreferrer">list of documented undefined behavior</a>.</p>