about summary refs log tree commit diff
path: root/src/test/run-pass
diff options
context:
space:
mode:
authorEduard-Mihai Burtescu <edy.burt@gmail.com>2017-02-25 14:13:25 +0200
committerGitHub <noreply@github.com>2017-02-25 14:13:25 +0200
commit33c19129c363eae3b84bdcc0fdf632f211dbd26a (patch)
tree194265bf8f890eabd02a94afcac327e70a3d552b /src/test/run-pass
parentef043a7c43070e125361e6609c85ea8a67631e0d (diff)
parent87e544bca5ae1bd187f11239abcab1f73c836049 (diff)
downloadrust-33c19129c363eae3b84bdcc0fdf632f211dbd26a.tar.gz
rust-33c19129c363eae3b84bdcc0fdf632f211dbd26a.zip
Rollup merge of #39980 - arielb1:privately-uninhabited, r=nikomatsakis
check_match: don't treat privately uninhabited types as uninhabited

Fixes #38972, which is a regression in 1.16 from @canndrew's patchset.

r? @nikomatsakis

beta-nominating because regression.
Diffstat (limited to 'src/test/run-pass')
-rw-r--r--src/test/run-pass/issue-38972.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/test/run-pass/issue-38972.rs b/src/test/run-pass/issue-38972.rs
new file mode 100644
index 00000000000..d5df84e0fb0
--- /dev/null
+++ b/src/test/run-pass/issue-38972.rs
@@ -0,0 +1,25 @@
+// 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 <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.
+
+// This issue tracks a regression (a new warning) without
+// feature(never_type). When we make that the default, please
+// remove this test.
+
+enum Foo { }
+
+fn make_foo() -> Option<Foo> { None }
+
+#[deny(warnings)]
+fn main() {
+    match make_foo() {
+        None => {},
+        Some(_) => {}
+    }
+}