title: What type should I use for a 2-dimensional array?
body: <p>What is wrong with the type of <code>a</code> here?</p>
  
  <pre><code>fn foo(a: &amp;[&amp;[f64]], x: &amp;[f64]) {
      for i in 0..3 {
          for j in 0..4 {
              println!("{}", a[i][j]);
          }
      }
  }
  
  fn main() {
      let A: [[f64; 4]; 3] = [
          [1.1, -0.2, 0.1, 1.6],
          [0.1, -1.2, -0.2, 2.3],
          [0.2, -0.1, 1.1, 1.5],
      ];
      let mut X: [f64; 3] = [0.0; 3];
  
      foo(&amp;A, &amp;X);
  }
  </code></pre>
  
  <p>I get the compilation failure:</p>
  
  <pre class="lang-none prettyprint-override"><code>error[E0308]: mismatched types
    --&gt; src/main.rs:17:9
     |
  17 |     foo(&amp;A, &amp;X);
     |         ^^ expected slice, found array of 3 elements
     |
     = note: expected type `&amp;[&amp;[f64]]`
                found type `&amp;[[f64; 4]; 3]`
  </code></pre>