about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPiotr Jawniak <sawyer47@gmail.com>2014-06-28 09:29:24 +0200
committerPiotr Jawniak <sawyer47@gmail.com>2014-06-28 09:30:44 +0200
commit5be84098b511595a8ccccbe3284ec99041bec251 (patch)
treeaad1ebf3fa30efd4a421227c2139b89213c5e81a
parent0ddf6f4b7c45bb6003a7c917e24583fc2b606826 (diff)
downloadrust-5be84098b511595a8ccccbe3284ec99041bec251.tar.gz
rust-5be84098b511595a8ccccbe3284ec99041bec251.zip
Add test for issue #12552
Closes #12552
-rw-r--r--src/test/compile-fail/issue-12552.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/compile-fail/issue-12552.rs b/src/test/compile-fail/issue-12552.rs
new file mode 100644
index 00000000000..e4788bac256
--- /dev/null
+++ b/src/test/compile-fail/issue-12552.rs
@@ -0,0 +1,21 @@
+// Copyright 2014 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 code used to cause an ICE
+
+fn main() {
+  let t = Err(0);
+  match t {
+    Some(k) => match k { //~ ERROR mismatched types
+      a => println!("{}", a)
+    },
+    None => () //~ ERROR mismatched types
+  }
+}