From 9449161aea9f05b9f680ed6538b1c4ac95b4186b Mon Sep 17 00:00:00 2001 From: Seo Sanghyeon Date: Fri, 26 Dec 2014 20:08:00 +0900 Subject: Do not resolve labels across function boundary --- src/test/compile-fail/resolve-label.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/test/compile-fail/resolve-label.rs (limited to 'src/test') 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 or the MIT license +// , 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() {} -- cgit 1.4.1-3-g733a5