<p dir="auto">This code:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="mod A {
    struct X;

    mod B {
        use A::X;
        pub fn foo(_: X) {}
    }
}"><pre class="notranslate"><span class="pl-k">mod</span> <span class="pl-v">A</span> <span class="pl-kos">{</span>
    <span class="pl-k">struct</span> <span class="pl-smi">X</span><span class="pl-kos">;</span>

    <span class="pl-k">mod</span> <span class="pl-v">B</span> <span class="pl-kos">{</span>
        <span class="pl-k">use</span> <span class="pl-smi">A</span><span class="pl-kos">::</span><span class="pl-v">X</span><span class="pl-kos">;</span>
        <span class="pl-k">pub</span> <span class="pl-k">fn</span> <span class="pl-en">foo</span><span class="pl-kos">(</span>_<span class="pl-kos">:</span> <span class="pl-smi">X</span><span class="pl-kos">)</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">Triggers:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="src\main.rs:6:23: 6:24 error: private type in exported type signature
src\main.rs:6         pub fn foo(_: X) {}"><pre class="notranslate"><code class="notranslate">src\main.rs:6:23: 6:24 error: private type in exported type signature
src\main.rs:6         pub fn foo(_: X) {}
</code></pre></div>
<p dir="auto">The <code class="notranslate">foo</code> function is only visible to <code class="notranslate">A</code> and <code class="notranslate">B</code>, and <code class="notranslate">X</code> is also visible to both <code class="notranslate">A</code> and <code class="notranslate">B</code>, so I don't see why this would be forbidden.</p>
<p dir="auto">This was introduced in the <code class="notranslate">rustc 1.0.0-nightly (f4e0ce66a 2015-03-19) (built 2015-03-20)</code> nightly. With the 2015-03-17, this works.</p>
<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>