title: Rust large array: thread 'main' has overflowed its stack
body: <p>New to Rust, and ran into this error <code>thread 'main' has overflowed its stack</code> for this code:</p>
  
  <pre class="lang-rust prettyprint-override"><code>fn main() {
      const N: usize = 10_000_000;
      let mut a: [u8; N]= [1; N];
      a[0] = 0;
  }
  </code></pre>
  
  <p>It is ok for <code>N = 1_000_000</code>. Is there a better way to allocate long array?</p>