title: Can I alias fully qualified syntax?
body: <p>I have some code where I have many instances of fully qualified syntax; as an example: </p>
  
  <pre><code>mod hal {
      pub trait Backend {
          type Device;
      }
  }
  
  mod back {
      pub struct Backend {}
  
      impl ::hal::Backend for Backend {
          type Device = i32;
      }
  }
  
  fn main() {
      let d: back::Backend::Device = 0;
  }
  </code></pre>
  
  <p><a href="https://play.rust-lang.org/?gist=710159b24866cf75bff623947e57bbb4&amp;version=stable&amp;mode=debug&amp;edition=2015" rel="nofollow noreferrer">playground</a></p>
  
  <p>In order to avoid errors like:</p>
  
  <pre class="lang-none prettyprint-override"><code>error[E0223]: ambiguous associated type
    --&gt; src/main.rs:16:12
     |
  16 |     let d: back::Backend::Device = 0;
     |            ^^^^^^^^^^^^^^^^^^^^^ ambiguous associated type
     |
     = note: specify the type using the syntax `&lt;back::Backend as Trait&gt;::Device`
  </code></pre>
  
  <p>Is there a nice way in which I can alias <code>SomeType as SomeTrait</code>? Then, wherever this instance of fully qualified syntax is needed, I can write:</p>
  
  <p><code>&lt;S&gt;::associated_fn(...)</code></p>
  
  <p>Note that this error does not occur because there are actually multiple implementations of some trait's definition (which is what FQS is supposed to handle, according to <em>The Rust Programming Language</em>).</p>