From 4c1a5054f08ddee3de4481a83eb0c8c1f9d36ab7 Mon Sep 17 00:00:00 2001 From: Andy Russell Date: Thu, 4 May 2017 16:13:52 -0400 Subject: [PATCH] add regression test for issue #24106 Fixes #24106. --- .../auxiliary/issue_24106.rs | 23 +++++++++++++++++++ src/test/run-pass-fulldeps/issue_24106.rs | 17 ++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 src/test/run-pass-fulldeps/auxiliary/issue_24106.rs create mode 100644 src/test/run-pass-fulldeps/issue_24106.rs diff --git a/src/test/run-pass-fulldeps/auxiliary/issue_24106.rs b/src/test/run-pass-fulldeps/auxiliary/issue_24106.rs new file mode 100644 index 0000000000000..745fbbe769e60 --- /dev/null +++ b/src/test/run-pass-fulldeps/auxiliary/issue_24106.rs @@ -0,0 +1,23 @@ +// Copyright 2017 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. + +#![crate_type="lib"] + +enum E { E0 = 0, E1 = 1 } +const E0_U8: u8 = E::E0 as u8; +const E1_U8: u8 = E::E1 as u8; + +pub fn go() { + match 0 { + E0_U8 => (), + E1_U8 => (), + _ => (), + } +} diff --git a/src/test/run-pass-fulldeps/issue_24106.rs b/src/test/run-pass-fulldeps/issue_24106.rs new file mode 100644 index 0000000000000..7cfd11537f4e9 --- /dev/null +++ b/src/test/run-pass-fulldeps/issue_24106.rs @@ -0,0 +1,17 @@ +// Copyright 2017 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. + +// aux-build:issue_24106.rs + +extern crate issue_24106; + +fn main() { + issue_24106::go::<()>(); +}