<p dir="auto">I'm finding when I link my program with -mwindows, it will crash instantly<br>
when run</p>
<p dir="auto">Some static functions may only make sense for certain constrained typarams, but this is disallowed. For example:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="type A&lt;T&gt; = ~[T];

impl&lt;T&gt; A&lt;T&gt; {
    static fn new() -&gt; A&lt;T&gt; { ~[] }
}

impl&lt;T: Copy&gt; A&lt;T&gt; {
    static fn new_copyable() -&gt; A&lt;T&gt; { ~[] }
}

fn main() {}"><pre class="notranslate"><code class="notranslate">type A&lt;T&gt; = ~[T];

impl&lt;T&gt; A&lt;T&gt; {
    static fn new() -&gt; A&lt;T&gt; { ~[] }
}

impl&lt;T: Copy&gt; A&lt;T&gt; {
    static fn new_copyable() -&gt; A&lt;T&gt; { ~[] }
}

fn main() {}
</code></pre></div>
<p dir="auto">However, rust errors with this message:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="test.rs:7:0: 9:1 error: duplicate definition of type A
test.rs:7 impl&lt;T: Copy&gt; A&lt;T&gt; {
test.rs:8     static fn new_copyable() -&gt; A&lt;T&gt; { ~[] }
test.rs:9 }
test.rs:3:0: 5:1 note: first definition of type A here:
test.rs:3 impl&lt;T&gt; A&lt;T&gt; {
test.rs:4     static fn new() -&gt; A&lt;T&gt; { ~[] }
test.rs:5 }
error: aborting due to previous error"><pre class="notranslate"><code class="notranslate">test.rs:7:0: 9:1 error: duplicate definition of type A
test.rs:7 impl&lt;T: Copy&gt; A&lt;T&gt; {
test.rs:8     static fn new_copyable() -&gt; A&lt;T&gt; { ~[] }
test.rs:9 }
test.rs:3:0: 5:1 note: first definition of type A here:
test.rs:3 impl&lt;T&gt; A&lt;T&gt; {
test.rs:4     static fn new() -&gt; A&lt;T&gt; { ~[] }
test.rs:5 }
error: aborting due to previous error
</code></pre></div>