title: How to create a boxed slice without using type ascription?
body: <p>It is easy to create a boxed slice:</p>
  <pre><code>fn main() {
      let _ = Box::new([42, 0]);
  }
  </code></pre>
  <p>But if I want to add specify a type:</p>
  <pre><code>fn main() {
      let _ = Box::&lt;[i32]&gt;::new([42, 0]);
  }
  </code></pre>
  <p>I get:</p>
  <pre class="lang-none prettyprint-override"><code>error: no associated item named `new` found for type `std::boxed::Box&lt;[i32]&gt;` in the current scope
    --&gt; src/main.rs:2:13
     |
   2 |     let _ = Box::&lt;[i32]&gt;::new([42, 0]);
     |             ^^^^^^^^^^^^^^^^^
     |
     = note: the method `new` exists but the following trait bounds were not satisfied: `[i32] : std::marker::Sized`
  </code></pre>
  <p>This is really strange, because it works with type ascription:</p>
  <pre><code>fn main() {
      let _: Box&lt;[i32]&gt; = Box::new([42, 0]);
  }
  </code></pre>