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