<p dir="auto">This doesn't work:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="trait Foo {
    type Bar;
    fn Bar();
}"><pre class="notranslate"><span class="pl-k">trait</span> <span class="pl-smi">Foo</span> <span class="pl-kos">{</span>
    <span class="pl-k">type</span> <span class="pl-smi">Bar</span><span class="pl-kos">;</span>
    <span class="pl-k">fn</span> <span class="pl-v">Bar</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">The error you get:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="trait_type_method_same_name.rs:3:5: 3:14 error: duplicate definition of type or module `Bar`
trait_type_method_same_name.rs:3     fn Bar();
                                     ^~~~~~~~~
trait_type_method_same_name.rs:2:5: 2:14 note: first definition of type or module `Bar` here
trait_type_method_same_name.rs:2     type Bar;
                                     ^~~~~~~~~"><pre class="notranslate"><code class="notranslate">trait_type_method_same_name.rs:3:5: 3:14 error: duplicate definition of type or module `Bar`
trait_type_method_same_name.rs:3     fn Bar();
                                     ^~~~~~~~~
trait_type_method_same_name.rs:2:5: 2:14 note: first definition of type or module `Bar` here
trait_type_method_same_name.rs:2     type Bar;
                                     ^~~~~~~~~
</code></pre></div>
<p dir="auto">It seems this should be allowed since they are in different namespaces.</p>
<p dir="auto">This is a FIXME issue; right now, an ident contains information used by expansion. After expansion, this is collapsed down to a single Name (an index into the interner). However, the downstream stuff in librustc refers to "ast::ident" everywhere.  It would save space and time to just pass around one int rather than two, by replacing uses of "ident" with "Name". I don't know if I'll have time to do this. (Planning for my untimely demi^H^Hparture.)</p>