title: Cannot resolve T: serde::Deserialize<'a> when deriving Deserialize on a generic struct
body: <p>I'm trying to write a struct that derives <code>serde::Deserialize</code> but it also has a field that should derive <code>serde::Deserialize</code>:</p>
  
  <pre><code>extern crate serde;
  #[macro_use]
  extern crate serde_derive;
  
  use serde::{Deserialize, Serialize};
  
  #[derive(PartialEq, Serialize, Deserialize)]
  pub struct Record&lt;'a, T&gt;
  where
      T: 'a + Serialize + Deserialize&lt;'a&gt;,
  {
      id: &amp;'a str,
      created_at: &amp;'a str,
      created_by: Option&lt;&amp;'a str&gt;,
      last_updated_at: Option&lt;&amp;'a str&gt;,
      object: &amp;'a T,
  }
  
  impl&lt;'a, T&gt; Record&lt;'a, T&gt;
  where
      T: 'a + Serialize + Deserialize&lt;'a&gt;,
  {
      pub fn new(
          id: &amp;'a str,
          created_at: &amp;'a str,
          created_by: Option&lt;&amp;'a str&gt;,
          last_updated_at: Option&lt;&amp;'a str&gt;,
          object: &amp;'a T,
      ) -&gt; Self {
          Record {
              id,
              created_at,
              created_by,
              last_updated_at,
              object,
          }
      }
  }
  
  fn main() {}
  </code></pre>
  
  <p>I've been changing the code for a while but I can't get this idea to compile. The error I'm getting at the moment is:</p>
  
  <pre class="lang-none prettyprint-override"><code>error[E0283]: type annotations required: cannot resolve `T: serde::Deserialize&lt;'a&gt;`
   --&gt; src/main.rs:7:32
    |
  7 | #[derive(PartialEq, Serialize, Deserialize)]
    |                                ^^^^^^^^^^^
    |
    = note: required by `serde::Deserialize`
  </code></pre>