title: Trait bound on generic trait
body: <p>I want to know how to create a generic function bound to a generic trait.</p>
  
  <p>In this example I have chosen <code>BitXor</code>. The declaration of <code>std::ops::BitXor</code> is <code>BitXor&lt;RHS, Result&gt;</code>.</p>
  
  <p>So if we have our function:</p>
  
  <pre><code>fn e&lt;T: BitXor&gt;(m:T, k:T) -&gt; T {
      m ^ k
  }
  </code></pre>
  
  <p>The compiler will complain:</p>
  
  <pre class="lang-none prettyprint-override"><code>error: Wrong number of type arguments: expected 2 but found 0.
  </code></pre>
  
  <p>So I tried:</p>
  
  <pre><code>fn e&lt;T: BitXor&lt;U, V&gt;, U, V&gt;(m:T, k:T) -&gt; T {
      m ^ k
  }
  </code></pre>
  
  <p>But get the rather confusing error:</p>
  
  <pre class="lang-none prettyprint-override"><code>Mismatched types: expected `U` but found `T` (expected type parameter but found type parameter).
  </code></pre>
  
  <p>Any solution?</p>