]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0030.md
Rollup merge of #92310 - ehuss:rustdoc-ice, r=estebank
[rust.git] / compiler / rustc_error_codes / src / 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 ```