title: Why does this Rust type alias need a lifetime parameter?
body: <p>I tried the following Rust type alias:</p>
  
  <pre><code>type Name = String;
  </code></pre>
  
  <p>It works fine. So I tried a variant:</p>
  
  <pre><code>type Name = &amp;str;
  </code></pre>
  
  <p>This failed with:</p>
  
  <pre class="lang-none prettyprint-override"><code>error[E0106]: missing lifetime specifier
   --&gt; src/main.rs:1:17
    |
  1 |     type Name = &amp;str;
    |                 ^ expected lifetime parameter
  </code></pre>
  
  <p>Why would a type alias need a lifetime parameter and how would I add it?</p>