-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Open
Labels
A-sliceArea: `[T]`Area: `[T]`C-optimizationCategory: An issue highlighting optimization opportunities or PRs implementing suchCategory: An issue highlighting optimization opportunities or PRs implementing suchI-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
When conditionally incrementing a usize
counter by 1, the optimizer doesn't detect that overflow is impossible, when using the Chars
iterator. As an example, I wrote a lines-of-codecontent counter that iterates over char
s: Playground
Can repro on 1.90.0-nightly (2025-07-14 a001497)
@rustbot label: +I-slow
Metadata
Metadata
Assignees
Labels
A-sliceArea: `[T]`Area: `[T]`C-optimizationCategory: An issue highlighting optimization opportunities or PRs implementing suchCategory: An issue highlighting optimization opportunities or PRs implementing suchI-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.