From b22c9c01fb4d4276e301a1ae0504a798a4f39fce Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Fri, 13 Apr 2018 18:31:15 +0200 Subject: Sign extend constants in range patterns --- src/test/ui/const-eval/const_signed_pat.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/test/ui/const-eval/const_signed_pat.rs (limited to 'src/test') 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 or the MIT license +// , 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 => {}, + _ => {}, + } +} -- cgit 1.4.1-3-g733a5