diff options
| author | bors <bors@rust-lang.org> | 2018-04-19 08:41:35 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-04-19 08:41:35 +0000 |
| commit | 5fe6b58dfc5ef9bb5dbfba9cf74aa9293a33e7b2 (patch) | |
| tree | 05677b42f57b1d5973e4d97473589a653e4d4d55 /src/test | |
| parent | 78fc5107430d73557df489b795d93b6ec7149cc3 (diff) | |
| parent | b22c9c01fb4d4276e301a1ae0504a798a4f39fce (diff) | |
| download | rust-5fe6b58dfc5ef9bb5dbfba9cf74aa9293a33e7b2.tar.gz rust-5fe6b58dfc5ef9bb5dbfba9cf74aa9293a33e7b2.zip | |
Auto merge of #49949 - oli-obk:const_signed_pat, r=eddyb
Sign extend constants in range patterns fixes #49940 r? @Mark-Simulacrum
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/const-eval/const_signed_pat.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/ui/const-eval/const_signed_pat.rs b/src/test/ui/const-eval/const_signed_pat.rs new file mode 100644 index 00000000000..f53d6f3fa0a --- /dev/null +++ b/src/test/ui/const-eval/const_signed_pat.rs @@ -0,0 +1,19 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-pass + +fn main() { + const MIN: i8 = -5; + match 5i8 { + MIN...-1 => {}, + _ => {}, + } +} |
