Skip to content

Commit

Permalink
Auto merge of #102529 - colinba:master, r=joshtriplett
Browse files Browse the repository at this point in the history
Detect and reject out-of-range integers in format string literals

Until now out-of-range integers in format string literals were silently ignored. They wrapped around to zero at usize::MAX, producing unexpected results.

When using debug builds of rustc, such integers in format string literals even cause an 'attempt to add with overflow' panic in rustc.

Fix this by producing an error diagnostic for integers in format string literals which do not fit into usize.

Fixes #102528
  • Loading branch information
bors committed Oct 14, 2022
2 parents 5d5bb36 + f37d280 commit d7ad82a
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit d7ad82a

Please sign in to comment.