2013-03-02 03:57:05 +00:00
|
|
|
struct Foo {
|
2014-05-22 23:57:53 +00:00
|
|
|
t: String
|
2013-03-02 03:57:05 +00:00
|
|
|
}
|
|
|
|
|
2013-11-11 19:29:15 +00:00
|
|
|
fn cond() -> bool { true }
|
|
|
|
|
2015-01-03 15:45:00 +00:00
|
|
|
fn foo<F>(_: F) where F: FnOnce() {}
|
2013-11-11 19:29:15 +00:00
|
|
|
|
2011-06-10 21:34:01 +00:00
|
|
|
fn main() {
|
2013-11-11 19:29:15 +00:00
|
|
|
let pth = break; //~ ERROR: `break` outside of loop
|
|
|
|
if cond() { continue } //~ ERROR: `continue` outside of loop
|
2011-06-10 21:34:01 +00:00
|
|
|
|
2013-11-11 19:29:15 +00:00
|
|
|
while cond() {
|
|
|
|
if cond() { break }
|
|
|
|
if cond() { continue }
|
2013-11-22 01:23:21 +00:00
|
|
|
foo(|| {
|
2013-11-11 19:29:15 +00:00
|
|
|
if cond() { break } //~ ERROR: `break` inside of a closure
|
|
|
|
if cond() { continue } //~ ERROR: `continue` inside of a closure
|
2013-11-22 01:23:21 +00:00
|
|
|
})
|
2013-11-11 19:29:15 +00:00
|
|
|
}
|
2011-06-10 21:34:01 +00:00
|
|
|
|
2013-11-11 19:29:15 +00:00
|
|
|
let rs: Foo = Foo{t: pth};
|
2014-04-04 23:05:31 +00:00
|
|
|
|
|
|
|
let unconstrained = break; //~ ERROR: `break` outside of loop
|
2011-08-19 22:16:48 +00:00
|
|
|
}
|