<p dir="auto">Suppose a <code class="notranslate">type</code> declaration is used to provide a shorter name for a specific example of a generic struct</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="struct X&lt;T&gt;;

impl&lt;T&gt; X&lt;T&gt; {
    fn go() -&gt; int {-1}
}

struct A;
type Alias = X&lt;A&gt;;"><pre class="notranslate"><span class="pl-k">struct</span> <span class="pl-smi">X</span><span class="pl-kos">&lt;</span><span class="pl-smi">T</span><span class="pl-kos">&gt;</span><span class="pl-kos">;</span>

<span class="pl-k">impl</span><span class="pl-kos">&lt;</span><span class="pl-smi">T</span><span class="pl-kos">&gt;</span> <span class="pl-smi">X</span><span class="pl-kos">&lt;</span><span class="pl-smi">T</span><span class="pl-kos">&gt;</span> <span class="pl-kos">{</span>
    <span class="pl-k">fn</span> <span class="pl-en">go</span><span class="pl-kos">(</span><span class="pl-kos">)</span> -&gt; <span class="pl-smi">int</span> <span class="pl-kos">{</span>-<span class="pl-c1">1</span><span class="pl-kos">}</span>
<span class="pl-kos">}</span>

<span class="pl-k">struct</span> <span class="pl-smi">A</span><span class="pl-kos">;</span>
<span class="pl-k">type</span> <span class="pl-smi">Alias</span> = <span class="pl-smi">X</span><span class="pl-kos">&lt;</span><span class="pl-smi">A</span><span class="pl-kos">&gt;</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">then its not possible to call a static method via <code class="notranslate">Alias</code></p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="fn main() {
    let a = X::&lt;A&gt;::go();  // Works
    let b = Alias::go();   // Won't compile - error: failed to resolve. Use of undeclared module `Alias`
}"><pre class="notranslate"><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> a = <span class="pl-smi">X</span><span class="pl-kos">::</span><span class="pl-kos">&lt;</span><span class="pl-smi">A</span><span class="pl-kos">&gt;</span><span class="pl-kos">::</span><span class="pl-en">go</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>  <span class="pl-c">// Works</span>
    <span class="pl-k">let</span> b = <span class="pl-smi">Alias</span><span class="pl-kos">::</span><span class="pl-en">go</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>   <span class="pl-c">// Won't compile - error: failed to resolve. Use of undeclared module `Alias`</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">Should the compiler expand <code class="notranslate">type</code> declarations in path expressions (ie <code class="notranslate">Alias =&gt; X::&lt;T&gt;</code>)?</p>
<p dir="auto">Compile this:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="pub mod foo {
    pub mod bar {
        pub mod baz {
            struct Qux;

            impl Qux {
                pub fn new() {}
            }
        }
    }
}

fn main() {
    type Ham = foo::bar::baz::Qux;
    let Foo = foo::bar::baz::Qux::new();  // works fine
    let Bar = Ham::new();  // oops!
}"><pre class="notranslate"><span class="pl-k">pub</span> <span class="pl-k">mod</span> foo <span class="pl-kos">{</span>
    <span class="pl-k">pub</span> <span class="pl-k">mod</span> bar <span class="pl-kos">{</span>
        <span class="pl-k">pub</span> <span class="pl-k">mod</span> baz <span class="pl-kos">{</span>
            <span class="pl-k">struct</span> <span class="pl-smi">Qux</span><span class="pl-kos">;</span>

            <span class="pl-k">impl</span> <span class="pl-smi">Qux</span> <span class="pl-kos">{</span>
                <span class="pl-k">pub</span> <span class="pl-k">fn</span> <span class="pl-en">new</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>
        <span class="pl-kos">}</span>
    <span class="pl-kos">}</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">type</span> <span class="pl-smi">Ham</span> = foo<span class="pl-kos">::</span>bar<span class="pl-kos">::</span>baz<span class="pl-kos">::</span><span class="pl-smi">Qux</span><span class="pl-kos">;</span>
    <span class="pl-k">let</span> <span class="pl-v">Foo</span> = foo<span class="pl-kos">::</span>bar<span class="pl-kos">::</span>baz<span class="pl-kos">::</span><span class="pl-smi">Qux</span><span class="pl-kos">::</span><span class="pl-en">new</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>  <span class="pl-c">// works fine</span>
    <span class="pl-k">let</span> <span class="pl-v">Bar</span> = <span class="pl-smi">Ham</span><span class="pl-kos">::</span><span class="pl-en">new</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>  <span class="pl-c">// oops!</span>
<span class="pl-kos">}</span></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ rustc ty.rs
!!! (resolving module in lexical scope) module wasn't actually a module!
ty.rs:16:14: 16:22 error: unresolved name
ty.rs:16     let Bar = Ham::new();
                       ^~~~~~~~
ty.rs:16:14: 16:22 error: use of undeclared module `Ham`
ty.rs:16     let Bar = Ham::new();
                       ^~~~~~~~
!!! (resolving module in lexical scope) module wasn't actually a module!
ty.rs:16:14: 16:22 error: unresolved name `Ham::new`.
ty.rs:16     let Bar = Ham::new();
                       ^~~~~~~~
error: aborting due to 3 previous errors
task 'rustc' failed at 'explicit failure', /root/catacombs/scrap/rust/src/libsyntax/diagnostic.rs:102
task '&lt;main&gt;' failed at 'explicit failure', /root/catacombs/scrap/rust/src/librustc/lib.rs:392"><pre class="notranslate"><code class="notranslate">$ rustc ty.rs
!!! (resolving module in lexical scope) module wasn't actually a module!
ty.rs:16:14: 16:22 error: unresolved name
ty.rs:16     let Bar = Ham::new();
                       ^~~~~~~~
ty.rs:16:14: 16:22 error: use of undeclared module `Ham`
ty.rs:16     let Bar = Ham::new();
                       ^~~~~~~~
!!! (resolving module in lexical scope) module wasn't actually a module!
ty.rs:16:14: 16:22 error: unresolved name `Ham::new`.
ty.rs:16     let Bar = Ham::new();
                       ^~~~~~~~
error: aborting due to 3 previous errors
task 'rustc' failed at 'explicit failure', /root/catacombs/scrap/rust/src/libsyntax/diagnostic.rs:102
task '&lt;main&gt;' failed at 'explicit failure', /root/catacombs/scrap/rust/src/librustc/lib.rs:392
</code></pre></div>
<p dir="auto">I can't imagine that this is intentional, as it greatly limits the utility of type aliases.</p>