title: implementing crate-local traits for multiple generic types cause conflicting implementations
body: <p>Following code causes conflicting implementations error:</p>
  <pre class="lang-rust prettyprint-override"><code>trait A&lt;S&gt; {}
  trait B&lt;S&gt; {}
  struct C&lt;T&gt;(T);
  
  impl &lt;T, S&gt; B&lt;S&gt; for T
  where T: A&lt;S&gt;
  {}
  
  impl&lt;T, S&gt; B&lt;S&gt; for C&lt;T&gt;
  where T: B&lt;S&gt;
  {}
  </code></pre>
  <pre><code>   Compiling playground v0.0.1 (/playground)
  error[E0119]: conflicting implementations of trait `B&lt;_&gt;` for type `C&lt;_&gt;`:
    --&gt; src/lib.rs:11:1
     |
  7  | / impl &lt;T, S&gt; B&lt;S&gt; for T
  8  | | where T: A&lt;S&gt;
  9  | | {}
     | |__- first implementation here
  10 | 
  11 | / impl&lt;T, S&gt; B&lt;S&gt; for C&lt;T&gt;
  12 | | where T: B&lt;S&gt;
  13 | | {}
     | |__^ conflicting implementation for `C&lt;_&gt;`
     |
     = note: downstream crates may implement trait `A&lt;_&gt;` for type `C&lt;_&gt;`
  
  error: aborting due to previous error
  
  For more information about this error, try `rustc --explain E0119`.
  error: could not compile `playground`.
  
  To learn more, run the command again with --verbose.
  </code></pre>
  <p><code>C</code> is a local type, can specialization resolve this problem?</p>
  <p>Moreover, it works if we replace <code>A&lt;S&gt;</code> with <code>Fn(S)</code>, is a compiler hole?</p>
  <pre class="lang-rust prettyprint-override"><code>trait B&lt;S&gt; {}
  
  struct C&lt;T&gt;(T);
  
  impl &lt;T, S&gt; B&lt;S&gt; for T
  where T: Fn(S)
  {}
  
  impl&lt;T, S&gt; B&lt;S&gt; for C&lt;T&gt;
  where T: B&lt;S&gt;
  {}
  </code></pre>