about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-12-29 16:36:15 -0800
committerAlex Crichton <alex@alexcrichton.com>2014-12-29 16:36:15 -0800
commit4dacf2780f90bd578606c4fd01de39b9c19b8573 (patch)
treeeddeee73fc9675d360ecfa6d2e17489bb1611353 /src/test
parent21f661a6ef813233aca16f0cbec939256640f021 (diff)
parentfbda51e27074b5cedce4c89091aee9adecb31ce0 (diff)
rollup merge of #20242: sanxiyn/break-from-fn
Fix #19331.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/resolve-label.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/compile-fail/resolve-label.rs b/src/test/compile-fail/resolve-label.rs
new file mode 100644
index 00000000000..398b4f5859e
--- /dev/null
+++ b/src/test/compile-fail/resolve-label.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.
+
+fn f() {
+    'l: loop {
+        fn g() {
+            loop {
+                break 'l; //~ ERROR use of undeclared label
+            }
+        }
+    }
+}
+
+fn main() {}