about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorJakub Wieczorek <jakub@jakub.cc>2014-05-31 00:16:33 +0200
committerJakub Wieczorek <jakub@jakub.cc>2014-05-31 21:10:02 +0200
commitb64046a5b072a34a0940785a9301669a2ea00031 (patch)
treef73f9204a2028a35499fd1778ae22439de94cdda /src/test
parentb38712071efd09fd602cef6a11621db09672f990 (diff)
downloadrust-b64046a5b072a34a0940785a9301669a2ea00031.tar.gz
rust-b64046a5b072a34a0940785a9301669a2ea00031.zip
Make the match arm type mismatch message point to the arm's span
Fixes #11319
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/issue-11319.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/compile-fail/issue-11319.rs b/src/test/compile-fail/issue-11319.rs
new file mode 100644
index 00000000000..1d9250305ef
--- /dev/null
+++ b/src/test/compile-fail/issue-11319.rs
@@ -0,0 +1,19 @@
+// 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.
+
+fn main() {
+    match Some(10) {
+    //~^ ERROR match arms have incompatible types: expected `bool` but found `()`
+        Some(5) => false,
+        Some(2) => true,
+        None    => (), //~ NOTE match arm with an incompatible type
+        _       => true
+    }
+}