Skip to content

Conversation

@alexcrichton
Copy link
Member

The previous code erroneously assumed that 'steals > cnt' was always true, but
that was a false assumption. The code was altered to decrement steals to a
minimum of 0 instead of taking all of cnt into account.

I didn't include the exact test from #12295 because it could run for quite
awhile, and instead set the threshold for MAX_STEALS to much lower during
testing. I found that this triggered the old bug quite frequently when running
without this fix.

Closes #12295

The previous code erroneously assumed that 'steals > cnt' was always true, but
that was a false assumption. The code was altered to decrement steals to a
minimum of 0 instead of taking all of cnt into account.

I didn't include the exact test from rust-lang#12295 because it could run for quite
awhile, and instead set the threshold for MAX_STEALS to much lower during
testing. I found that this triggered the old bug quite frequently when running
without this fix.

Closes rust-lang#12295
bors added a commit that referenced this pull request Feb 16, 2014
The previous code erroneously assumed that 'steals > cnt' was always true, but
that was a false assumption. The code was altered to decrement steals to a
minimum of 0 instead of taking all of cnt into account.

I didn't include the exact test from #12295 because it could run for quite
awhile, and instead set the threshold for MAX_STEALS to much lower during
testing. I found that this triggered the old bug quite frequently when running
without this fix.

Closes #12295
@bors bors closed this Feb 16, 2014
@bors bors merged commit bea7862 into rust-lang:master Feb 16, 2014
@alexcrichton alexcrichton deleted the issue-12295 branch February 19, 2014 18:28
flip1995 pushed a commit to flip1995/rust that referenced this pull request Feb 20, 2025
…nario (rust-lang#14168)

Fixes rust-lang#12302

changelog: [`just_underscores_and_digits`]: fix false positive in error
recovery scenario
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

assertion failed: self.steals >= 0

3 participants