<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="mod test_mod {
    enum A {
        Foo,
    }
}

type Alias = test_mod::A;

let _v = Alias::Foo; // Compile error"><pre class="notranslate"><span class="pl-k">mod</span> test_mod <span class="pl-kos">{</span>
    <span class="pl-k">enum</span> <span class="pl-smi">A</span> <span class="pl-kos">{</span>
        <span class="pl-v">Foo</span><span class="pl-kos">,</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span>

<span class="pl-k">type</span> <span class="pl-smi">Alias</span> = test_mod<span class="pl-kos">::</span><span class="pl-smi">A</span><span class="pl-kos">;</span>

<span class="pl-k">let</span> _v = <span class="pl-smi">Alias</span><span class="pl-kos">::</span><span class="pl-v">Foo</span><span class="pl-kos">;</span> <span class="pl-c">// Compile error</span></pre></div>
<p dir="auto">type items don't work with enums.</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#[derive(Debug)]
enum Foo {
    Bar,
    Baz,
}
type Loz = Foo;
fn main() {
    let y = Loz::Bar;
    println!(&quot;{:?}&quot;, y);
}"><pre class="notranslate"><span class="pl-c1">#<span class="pl-kos">[</span>derive<span class="pl-kos">(</span><span class="pl-v">Debug</span><span class="pl-kos">)</span><span class="pl-kos">]</span></span>
<span class="pl-k">enum</span> <span class="pl-smi">Foo</span> <span class="pl-kos">{</span>
    <span class="pl-v">Bar</span><span class="pl-kos">,</span>
    <span class="pl-v">Baz</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span>
<span class="pl-k">type</span> <span class="pl-smi">Loz</span> = <span class="pl-smi">Foo</span><span class="pl-kos">;</span>
<span class="pl-k">fn</span> <span class="pl-en">main</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">let</span> y = <span class="pl-smi">Loz</span><span class="pl-kos">::</span><span class="pl-v">Bar</span><span class="pl-kos">;</span>
    <span class="pl-en">println</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-s">"{:?}"</span>, y<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">On the stable channel the following error occurs:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;anon&gt;:8:13: 8:21 error: type `Foo` does not implement any method in scope named `Bar`
&lt;anon&gt;:8     let y = Loz::Bar;
                     ^~~~~~~~
error: aborting due to previous error
playpen: application terminated with error code 101```"><pre class="notranslate"><code class="notranslate">&lt;anon&gt;:8:13: 8:21 error: type `Foo` does not implement any method in scope named `Bar`
&lt;anon&gt;:8     let y = Loz::Bar;
                     ^~~~~~~~
error: aborting due to previous error
playpen: application terminated with error code 101```
</code></pre></div>