title: How do I automatically implement comparison for structs with floats in Rust?
body: <p>I'm trying to automatically "derive" comparison functionality for a simple struct like this:</p>
  
  <pre><code>#[derive(PartialEq, Eq)]
  struct Vec3 {
      x: f64,
      y: f64,
      z: f64,
  }
  </code></pre>
  
  <p>However, Rust 1.15.1 complains:</p>
  
  <pre class="lang-none prettyprint-override"><code>error[E0277]: the trait bound `f64: std::cmp::Eq` is not satisfied
   --&gt; src/main.rs:3:5
    |
  3 |     x: f64,
    |     ^^^^^^ the trait `std::cmp::Eq` is not implemented for `f64`
    |
    = note: required by `std::cmp::AssertParamIsEq`
  </code></pre>
  
  <p>What exactly am I supposed to do to allow the derivation of a default implementation here?</p>