]> git.lizzy.rs Git - rust.git/blob - src/test/ui/inline-const/const-match-pat-range.rs
Rollup merge of #95534 - jyn514:std-mem-copy, r=joshtriplett
[rust.git] / src / test / ui / inline-const / const-match-pat-range.rs
1 // build-pass
2
3 #![allow(incomplete_features)]
4 #![feature(inline_const_pat, half_open_range_patterns, exclusive_range_pattern)]
5 fn main() {
6     const N: u32 = 10;
7     let x: u32 = 3;
8
9     match x {
10         1 ..= const { N + 1 } => {},
11         _ => {},
12     }
13
14     match x {
15         const { N - 1 } ..= 10 => {},
16         _ => {},
17     }
18
19     match x {
20         const { N - 1 } ..= const { N + 1 } => {},
21         _ => {},
22     }
23
24     match x {
25         .. const { N + 1 } => {},
26         _ => {},
27     }
28
29     match x {
30         const { N - 1 } .. => {},
31         _ => {},
32     }
33
34     match x {
35         ..= const { N + 1 } => {},
36         _ => {}
37     }
38 }