diff options
| author | Santiago Pastorino <spastorino@gmail.com> | 2020-10-19 18:44:37 -0300 |
|---|---|---|
| committer | Santiago Pastorino <spastorino@gmail.com> | 2020-10-22 13:22:12 -0300 |
| commit | 83abed9df6ad0a8881270f166a02ffcaf437422f (patch) | |
| tree | 018b82b1957cc65ecd597e93f85cd2e6ab97a5bc /src/test/ui/inline-const | |
| parent | f8842b9bacaf277430fa5c6cdf430b046dc7f323 (diff) | |
| download | rust-83abed9df6ad0a8881270f166a02ffcaf437422f.tar.gz rust-83abed9df6ad0a8881270f166a02ffcaf437422f.zip | |
Make inline const work for half open ranges
Diffstat (limited to 'src/test/ui/inline-const')
| -rw-r--r-- | src/test/ui/inline-const/const-match-pat-range.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/test/ui/inline-const/const-match-pat-range.rs b/src/test/ui/inline-const/const-match-pat-range.rs index 4fbccfaf200..c50c4f42848 100644 --- a/src/test/ui/inline-const/const-match-pat-range.rs +++ b/src/test/ui/inline-const/const-match-pat-range.rs @@ -1,7 +1,7 @@ // build-pass #![allow(incomplete_features)] -#![feature(inline_const)] +#![feature(inline_const, half_open_range_patterns, exclusive_range_pattern)] fn main() { const N: u32 = 10; let x: u32 = 3; @@ -20,4 +20,14 @@ fn main() { 1 ..= const { N + 1 } => {}, _ => {}, } + + match x { + .. const { N + 1 } => {}, + _ => {}, + } + + match x { + const { N - 1 } .. => {}, + _ => {}, + } } |
