<p dir="auto">Regression from the change to make newtype structs immediates.</p>
<p dir="auto">Minimal test case:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="struct Wrapper(~str);

impl Wrapper {
    pub fn new() -&gt; Wrapper {
        Wrapper(~&quot;Bob&quot;)
    }

    pub fn say_hi(&amp;self) {
        println(fmt!(&quot;hello %s&quot;, **self));
    }
}

impl Drop for Wrapper {
    fn drop(&amp;mut self) {}
}

fn main() {
    {
        // This runs without complaint.
        let x = Wrapper::new();
        x.say_hi();
    }
    {
        // This fails to compile.
        // error: internal compiler error: drop_ty_immediate: non-box ty
        Wrapper::new().say_hi();
    }
}"><pre class="notranslate"><code class="notranslate">struct Wrapper(~str);

impl Wrapper {
    pub fn new() -&gt; Wrapper {
        Wrapper(~"Bob")
    }

    pub fn say_hi(&amp;self) {
        println(fmt!("hello %s", **self));
    }
}

impl Drop for Wrapper {
    fn drop(&amp;mut self) {}
}

fn main() {
    {
        // This runs without complaint.
        let x = Wrapper::new();
        x.say_hi();
    }
    {
        // This fails to compile.
        // error: internal compiler error: drop_ty_immediate: non-box ty
        Wrapper::new().say_hi();
    }
}
</code></pre></div>
<p dir="auto">I originally ran accross this when wrapping a <code class="notranslate">*T</code>, but it also fails when I try to wrap <code class="notranslate">int</code> and other numeric types, <code class="notranslate">bool</code>, <code class="notranslate">Option&lt;T&gt;</code>, <code class="notranslate">~T</code>, and other structs that also wrap a single value of those types.</p>