Closed as not planned
Description
In #90886 I changed the definition of fold
such that it no longer needed the mut
on the f
parameter, and was surprised to get a UI test failure (in https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-3044.rs) from it. The update from bless
:
Playground link with the same as that UI test: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=548bf44a26aa1406bafb496f9341bf29
It doesn't seem to be showing the note in playground, though?!?
The current output is:
note: associated function defined here
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | fn fold<B, F>(mut self, init: B, mut f: F) -> B
| ^^^^
Ideally the output should look like:
note: associated function defined here
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | fn fold<B, F>(self, init: B, f: F) -> B
| ^^^^
because the mut
s are not relevant to the caller of the function.