mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-28 03:07:24 +03:00
901fe3f804
When `pop_front` was called while the cursor pointed to the front element, `move_next` incremented the index but it was never decremented afterwards, causing the index to incorrectly report 1 instead of 0. Always decrement the index after popping from front using `saturating_sub` to handle edge cases safely.