title: How do I make a trait that is restricted to types who implement another trait where `&Self` self is a trait's type?
body: <p>For instance, I want every <code>MyTrait</code> to implement <code>AddAssign&lt;&amp;'a Self&gt;</code>. This is as far as I got, after placing <code>'a</code> where the compiler wanted:</p>
  <pre class="lang-rs prettyprint-override"><code>trait MyTrait&lt;'a&gt;: 'a + std::ops::AddAssign&lt;&amp;'a Self&gt; {}
  
  fn func&lt;'a, T: MyTrait&lt;'a&gt;&gt;(a: &amp;mut T, b: T) {
      *a += &amp;b;
  }
  </code></pre>
  <p>This code fails with the following error:</p>
  <pre><code>error[E0597]: `b` does not live long enough
   --&gt; src/main.rs:4:11
    |
  3 | fn func&lt;'a, T: MyTrait&lt;'a&gt;&gt;(a: &amp;mut T, b: T) {
    |         -- lifetime `'a` defined here
  4 |     *a += &amp;b;
    |           ^^
    |           |
    |           borrowed value does not live long enough
    |           requires that `b` is borrowed for `'a`
  5 | }
    | - `b` dropped here while still borrowed
  
  For more information about this error, try `rustc --explain E0597`.
  </code></pre>
  <p>How do I tell the compiler that <code>&amp;b</code> will only be used for the duration of that sum?</p>