Commit ef4b306
committed
Auto merge of rust-lang#89774 - the8472:inline-mut-iter-next, r=m-ou-se
inline next() on &mut Iterator impl
In [rust-lang#87431](https://github.com/rust-lang/rust/pull/87431/files#diff-79a6b417b85ecf4f1a4ef2235135fedf540199caf6e9e1d154ac6a413b40a757R132-R136) I found that `(&mut range).fold` doesn't optimize well because the default impl for for `fold` on `&mut Iterator` doesn't inline `next`. In that particular case it was worked around by using `try_fold` which takes a `&mut self` instead of `self`.
Let's see if this can be fixed more broadly.2 files changed
+7
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
151 | 144 | | |
152 | 145 | | |
153 | 146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3460 | 3460 | | |
3461 | 3461 | | |
3462 | 3462 | | |
| 3463 | + | |
3463 | 3464 | | |
3464 | 3465 | | |
3465 | 3466 | | |
| |||
0 commit comments