about summary refs log tree commit diff
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2016-12-20 03:34:36 +0100
committerest31 <MTest31@outlook.com>2016-12-20 03:34:36 +0100
commit54f75c95722c12da32ca63301fe8548322018a97 (patch)
tree9a521ecd2cc70fbafa1dc408c5dc3ef222e49d53
parent94ae2a2e6791e0c4ab6fba836b2b09a07f2d3c8a (diff)
downloadrust-54f75c95722c12da32ca63301fe8548322018a97.tar.gz
rust-54f75c95722c12da32ca63301fe8548322018a97.zip
Add regression test for #38458
-rw-r--r--src/test/compile-fail/issue-38458.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/compile-fail/issue-38458.rs b/src/test/compile-fail/issue-38458.rs
new file mode 100644
index 00000000000..56eb5f874cd
--- /dev/null
+++ b/src/test/compile-fail/issue-38458.rs
@@ -0,0 +1,15 @@
+// Copyright 2016 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.
+
+const x: () = {
+    return; //~ ERROR return statement outside of function body
+};
+
+fn main() {}