title: Accessing mutable reference with getter not working as expected
body: <p>I'm trying to make a struct that holds an mutable reference. Accessing the mutable reference multiple times through its field works fine. However, if I use a getter instead, it does not compile.</p>
  
  <pre><code>struct IntBorrower&lt;'inner&gt;(&amp;'inner mut i32);
  
  impl&lt;'outer: 'inner, 'inner&gt; IntBorrower&lt;'inner&gt; {
      fn int_mut(&amp;'outer mut self) -&gt; &amp;'inner mut i32 {
          &amp;mut self.0
      }
  
      //this compiles
      fn do_something(&amp;'outer mut self) {
          {
              *self.0 += 5;
          }
  
          {
              *self.0 += 5;
          }
      }
  
      //this does not compile
      fn do_something_but_with_getters(&amp;'outer mut self) {
          {
              *self.int_mut() += 5;
          }
  
          {
              *self.int_mut() += 5;
          }
      }
  }
  
  fn main() {}
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre class="lang-none prettyprint-override"><code>error[E0499]: cannot borrow `*self` as mutable more than once at a time
    --&gt; src/main.rs:26:14
     |
  22 |             *self.int_mut() += 5;
     |              ---- first mutable borrow occurs here
  ...
  26 |             *self.int_mut() += 5;
     |              ^^^^ second mutable borrow occurs here
  27 |         }
  28 |     }
     |     - first borrow ends here
  </code></pre>
  
  <p>Shouldn't the first mutable borrow end inside those brackets just like in the previous function? Why does this happen? </p>