]> git.lizzy.rs Git - rust.git/blob - src/librustc_error_codes/error_codes/E0030.md
Rollup merge of #62514 - stephaneyfx:box-ffi, r=nikomatsakis
[rust.git] / src / librustc_error_codes / error_codes / E0030.md
1 When matching against a range, the compiler verifies that the range is
2 non-empty. Range patterns include both end-points, so this is equivalent to
3 requiring the start of the range to be less than or equal to the end of the
4 range.
5
6 Erroneous code example:
7
8 ```compile_fail,E0030
9 match 5u32 {
10     // This range is ok, albeit pointless.
11     1 ..= 1 => {}
12     // This range is empty, and the compiler can tell.
13     1000 ..= 5 => {}
14 }
15 ```