title: expected fn pointer, found closure
body: <p>I am trying to write a function that accumulates numbers provided by a supplier for a given range starting from zero:</p>
  <pre><code>fn accumulate&lt;F&gt;(size: usize, supplier: F) -&gt; Successors&lt;f64, fn(&amp;f64) -&gt; Option&lt;f64&gt;&gt;
      where F: Fn(usize) -&gt; f64 {
      let mut range = 0..size;
      successors(
          Some(0.0),
          |acc| range.next().map(|n| *acc + supplier(n)),
      )
  }
  </code></pre>
  <p>The error message is:</p>
  <pre class="lang-none prettyprint-override"><code>114 |         |acc| range.next().map(|n| *acc + supplier(&amp;config, n)),
      |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found closure
  </code></pre>
  <p>This is strange because the successors function expects a closure, namely <code>FnMut</code>. What am I doing wrong?</p>