about summary refs log tree commit diff
path: root/src/test/compile-fail
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2016-12-20 11:16:49 -0800
committerAlex Crichton <alex@alexcrichton.com>2016-12-20 12:59:11 -0800
commit10bb4a4801243f2465fa9b17cfa7ab40f7f3980d (patch)
treebfbeaa3af7779ea38540c487b13ea050b33442a9 /src/test/compile-fail
parent802784d89b9583c1978c98839aeeda02ecc80870 (diff)
parent54f75c95722c12da32ca63301fe8548322018a97 (diff)
downloadrust-10bb4a4801243f2465fa9b17cfa7ab40f7f3980d.tar.gz
rust-10bb4a4801243f2465fa9b17cfa7ab40f7f3980d.zip
Rollup merge of #38486 - est31:master, r=petrochenkov
Add regression test for #38458

Closes #38458
Diffstat (limited to 'src/test/compile-fail')
-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() {}