summary refs log tree commit diff
path: root/src/test/parse-fail
diff options
context:
space:
mode:
authorKevin Butler <haqkrs@gmail.com>2015-10-27 13:41:55 +0000
committerKevin Butler <haqkrs@gmail.com>2015-10-28 22:32:07 +0000
commit99ecf4e2c94a72a68294111ecdf6a82c150c378a (patch)
treeec1bceda822241a263a3929e09dc051bfa2ae8d9 /src/test/parse-fail
parent65623dba0d0c39de0e7cc66a31bce45328c3caa8 (diff)
downloadrust-99ecf4e2c94a72a68294111ecdf6a82c150c378a.tar.gz
rust-99ecf4e2c94a72a68294111ecdf6a82c150c378a.zip
libsyntax: improve error message when a statement is prefixed with a match keyword
Diffstat (limited to 'src/test/parse-fail')
-rw-r--r--src/test/parse-fail/match-refactor-to-expr.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/parse-fail/match-refactor-to-expr.rs b/src/test/parse-fail/match-refactor-to-expr.rs
new file mode 100644
index 00000000000..e85fb3c9dd5
--- /dev/null
+++ b/src/test/parse-fail/match-refactor-to-expr.rs
@@ -0,0 +1,18 @@
+// Copyright 2015 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() {
+    let foo =
+        match //~ NOTE did you mean to remove this `match` keyword?
+        Some(4).unwrap_or_else(5)
+        ; //~ ERROR expected one of `.`, `{`, or an operator, found `;`
+
+    println!("{}", foo)
+}