title: How does Rust determine the length of a slice when unsizing from an array?
body: <p>I know that a slice is like a fatptr: <code>(data_ptr, len)</code>. When I slice an array into a slice:</p>
  
  <pre class="lang-rust prettyprint-override"><code>let arr = [0; 10];
  let slice_arr = &amp;arr[..];
  </code></pre>
  
  <p>An array doesn't have a length field like <code>Vec&lt;T&gt;</code>. </p>
  
  <p>I know that <code>slice_arr.len()</code> can get the length of slice because <code>slice_arr</code> has a length field. How does Rust know the length field when an array is converted into a slice? </p>