1
Fork 0

more --blessing + test error annotations fixes

This commit is contained in:
Artem Varaksa 2019-08-21 15:13:13 +03:00
parent dd7082e3d2
commit 600a64bdb5
6 changed files with 14 additions and 14 deletions

View file

@ -1,11 +1,11 @@
fn main() {
loop {
|_: [_; break]| {} //~ ERROR: `break` outside of loop
|_: [_; break]| {} //~ ERROR: `break` outside of a loop
//~^ ERROR mismatched types
}
loop {
|_: [_; continue]| {} //~ ERROR: `continue` outside of loop
|_: [_; continue]| {} //~ ERROR: `continue` outside of a loop
//~^ ERROR mismatched types
}
}

View file

@ -30,14 +30,14 @@ async fn return_targets_async_block_not_async_fn() -> u8 {
fn no_break_in_async_block() {
async {
break 0u8; //~ ERROR `break` inside of an async block
break 0u8; //~ ERROR `break` inside of an `async` block
};
}
fn no_break_in_async_block_even_with_outer_loop() {
loop {
async {
break 0u8; //~ ERROR `break` inside of an async block
break 0u8; //~ ERROR `break` inside of an `async` block
};
}
}

View file

@ -1,4 +1,4 @@
error[E0267]: `break` inside of an async block
error[E0267]: `break` inside of an `async` block
--> $DIR/async-block-control-flow-static-semantics.rs:33:9
|
LL | async {
@ -8,7 +8,7 @@ LL | | break 0u8;
LL | | };
| |_____- enclosing `async` block
error[E0267]: `break` inside of an async block
error[E0267]: `break` inside of an `async` block
--> $DIR/async-block-control-flow-static-semantics.rs:40:13
|
LL | async {

View file

@ -7,8 +7,8 @@ fn cond() -> bool { true }
fn foo<F>(_: F) where F: FnOnce() {}
fn main() {
let pth = break; //~ ERROR: `break` outside of loop
if cond() { continue } //~ ERROR: `continue` outside of loop
let pth = break; //~ ERROR: `break` outside of a loop
if cond() { continue } //~ ERROR: `continue` outside of a loop
while cond() {
if cond() { break }
@ -21,5 +21,5 @@ fn main() {
let rs: Foo = Foo{t: pth};
let unconstrained = break; //~ ERROR: `break` outside of loop
let unconstrained = break; //~ ERROR: `break` outside of a loop
}

View file

@ -1,9 +1,9 @@
fn main() {
|_: [_; continue]| {}; //~ ERROR: `continue` outside of loop
|_: [_; continue]| {}; //~ ERROR: `continue` outside of a loop
while |_: [_; continue]| {} {} //~ ERROR: `continue` outside of loop
while |_: [_; continue]| {} {} //~ ERROR: `continue` outside of a loop
//~^ ERROR mismatched types
while |_: [_; break]| {} {} //~ ERROR: `break` outside of loop
while |_: [_; break]| {} {} //~ ERROR: `break` outside of a loop
//~^ ERROR mismatched types
}

View file

@ -1,8 +1,8 @@
// Make sure that a continue span actually contains the keyword.
fn main() {
continue //~ ERROR `continue` outside of loop
continue //~ ERROR `continue` outside of a loop
;
break //~ ERROR `break` outside of loop
break //~ ERROR `break` outside of a loop
;
}