]> git.lizzy.rs Git - rust.git/blob - src/test/ui/inc-range-pat.rs
Merge commit 'd3a2366ee877075c59b38bd8ced55f224fc7ef51' into sync_cg_clif-2022-07-26
[rust.git] / src / test / ui / inc-range-pat.rs
1 // run-pass
2 // Test old and new syntax for inclusive range patterns.
3
4 #![allow(ellipsis_inclusive_range_patterns)]
5
6 fn main() {
7     assert!(match 42 { 0 ... 100 => true, _ => false });
8     assert!(match 42 { 0 ..= 100 => true, _ => false });
9
10     assert!(match 'x' { 'a' ... 'z' => true, _ => false });
11     assert!(match 'x' { 'a' ..= 'z' => true, _ => false });
12 }