title: What is the reason for requiring &mut foo instead of &foo when foo has been declared mutable?
body: <p>For a C routine like</p>
  <pre class="lang-c prettyprint-override"><code>MPI_Comm_rank(MPI_Comm comm, int *rank);
  </code></pre>
  <p>The Rust foreign function interface could be declared like this:</p>
  <pre class="lang-rust prettyprint-override"><code>use libc::c_int; // 0.2.79
  
  #[link(name = &quot;mpi&quot;)]
  extern &quot;C&quot; {
      fn MPI_Comm_rank(mpi_comm: c_int, rank: *mut c_int);
  }
  </code></pre>
  <p>I call the binding like this, which works, but left me puzzled about syntax:</p>
  <pre class="lang-rust prettyprint-override"><code>pub static MPI_COMM_WORLD: libc::c_int = 0x44000000;
  fn main() {
      let mut rank: c_int = 999999;
      /* but why '&amp;mut rank' and not simply '&amp;rank' ? */
      unsafe { MPI_Comm_rank(MPI_COMM_WORLD, &amp;mut rank) }
  }
  </code></pre>
  <p>I originally tried</p>
  <pre><code>unsafe { MPI_Comm_rank(MPI_COMM_WORLD, &amp;rank) }
  </code></pre>
  <p>but this gives a compiler error:</p>
  <pre class="lang-none prettyprint-override"><code>error[E0308]: mismatched types
    --&gt; src/main.rs:12:44
     |
  12 |     unsafe { MPI_Comm_rank(MPI_COMM_WORLD, &amp;rank) }
     |                                            ^^^^^ types differ in mutability
     |
     = note: expected raw pointer `*mut i32`
                  found reference `&amp;i32`
  </code></pre>
  <p>I declared 'rank' as mut, so what gives?</p>