1
Fork 0

Rollup merge of #106622 - estebank:issue-68972, r=davidtwco

Detect out of bounds range pattern value

Fix #68972.
This commit is contained in:
Matthias Krüger 2023-01-11 21:08:07 +01:00 committed by GitHub
commit 88765b0f59
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 115 additions and 6 deletions

View file

@ -206,6 +206,10 @@ mir_build_lower_range_bound_must_be_less_than_or_equal_to_upper =
.label = lower bound larger than upper bound
.teach_note = When matching against a range, the compiler verifies that the range is non-empty. Range patterns include both end-points, so this is equivalent to requiring the start of the range to be less than or equal to the end of the range.
mir_build_literal_in_range_out_of_bounds =
literal out of range for `{$ty}`
.label = this value doesn't fit in `{$ty}` whose maximum value is `{$max}`
mir_build_lower_range_bound_must_be_less_than_upper = lower range bound must be less than upper
mir_build_leading_irrefutable_let_patterns = leading irrefutable {$count ->