<p dir="auto">Code example:</p>
<p dir="auto">Save this in <code class="notranslate">main.rs</code> and try to compile.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="enum T {}
type New = T;

impl New {}

fn main() {}"><pre class="notranslate"><code class="notranslate">enum T {}
type New = T;

impl New {}

fn main() {}
</code></pre></div>
<p dir="auto">Trying to compile, it shows this error:</p>
<p dir="auto">impl.rs:4:1: 4:12 error: cannot associate methods with a type outside the crate the type is defined in; define and implement a trait or new type instead<br>
impl.rs:4 impl New {}<br>
^~~~~~~~~~~<br>
error: aborting due to previous error</p>
<p dir="auto">Using git master HEAD: <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/rust-lang/rust/commit/6fcf43e50e9dd8ad8dc83d550e25f738f821f1ce/hovercard" href="https://github.com/rust-lang/rust/commit/6fcf43e50e9dd8ad8dc83d550e25f738f821f1ce"><tt>6fcf43e</tt></a></p>
<p dir="auto">Top-level functions can't be passed as lvalues to functions. Instead they have to be assigned to a temporary first.</p>