title: "conflicting implementations for trait" when trying to be generic
body: <p>Background: I'm using the <code>nalgebra</code> library and I want to create a structure that represents a multivariate normal distribution. <code>M</code> is the type of the matrix, e.g. <code>Mat4&lt;f64&gt;</code>.</p>
  
  <p>My current attempt looks like this:</p>
  
  <pre><code>use std::ops::Mul;
  use std::marker::PhantomData;
  use nalgebra::*;
  
  #[allow(non_snake_case)]
  pub struct Multivar&lt;N, V, M: SquareMat&lt;N, V&gt;&gt; {
      μ: V,
      Σ: M,
      marker: PhantomData&lt;N&gt;
  }
  
  impl&lt;N, V, M&gt; Mul&lt;Multivar&lt;N, V, M&gt;&gt; for M {
      type Output = Multivar&lt;N, V, M&gt;;
      fn mul(self, rhs: Multivar&lt;N, V, M&gt;) -&gt; Multivar&lt;N, V, M&gt; {
          Multivar {
              μ: self * rhs.μ,
              Σ: self * rhs.Σ * transpose(&amp;self)
          }
      }
  }
  </code></pre>
  
  <p>However, the compiler complains with:</p>
  
  <p><code>error: type parameter `M` must be used as the type parameter for some local type (e.g. `MyStruct&lt;T&gt;`); only traits defined in the current crate can be implemented for a type parameter</code></p>
  
  <p>and </p>
  
  <p><code>error: conflicting implementations for trait `core::ops::Mul`</code></p>
  
  <p>I don't believe this should be an error since I'm defining an implementation for a struct I have defined in this module. How should I fix this?</p>