mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 08:44:35 +00:00
71704c4f84
Fix overflow checking in range patterns When a range pattern contains an overflowing literal, if we're not careful we might not notice the overflow and use the wrapped value. This makes for confusing error messages because linting against overflowing literals is only done in a later pass. So when a range is invalid we check for overflows to provide a better error. This check didn't use to handle negative types; this PR fixes that. First commit adds tests, second cleans up without changing behavior, third does the fix. EDIT: while I was at it, I fixed a small annoyance about the span of the overflow lint on negated literals. Fixes https://github.com/rust-lang/rust/issues/94239 |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
messages.ftl |