title: Why can't I implement Deref for a specific lifetime?
body: <pre><code>use std::ops::{Deref};
  use std::sync::{MutexGuard};
  
  pub struct MutexGuardRef&lt;'a, T&gt; {
      mutex_guard: MutexGuard&lt;'a, Option&lt;Box&lt;T&gt;&gt;&gt;,
  }
  
  impl&lt;'a, T&gt; Deref for MutexGuardRef&lt;'a, T&gt; {
      type Target = Option&lt;T&gt;;
  
      fn deref(&amp;'a self) -&gt; &amp;'a Self::Target {
          &amp;self.mutex_guard.deref().as_ref().map(|x|*x)
      }
  }
  </code></pre>
  <p>this gives:</p>
  <pre><code>   = note: expected fn pointer `fn(&amp;MutexGuardRef&lt;'a, T&gt;) -&gt; &amp;Option&lt;T&gt;`
                found fn pointer `fn(&amp;'a MutexGuardRef&lt;'a, T&gt;) -&gt; &amp;'a Option&lt;T&gt;`
  </code></pre>
  <p>Why can't I implement a trait for a specific lifetime? Why does it have to be all lifetimes?</p>