more --bless
ing + test error annotations fixes
This commit is contained in:
parent
dd7082e3d2
commit
600a64bdb5
6 changed files with 14 additions and 14 deletions
|
@ -1,11 +1,11 @@
|
||||||
fn main() {
|
fn main() {
|
||||||
loop {
|
loop {
|
||||||
|_: [_; break]| {} //~ ERROR: `break` outside of loop
|
|_: [_; break]| {} //~ ERROR: `break` outside of a loop
|
||||||
//~^ ERROR mismatched types
|
//~^ ERROR mismatched types
|
||||||
}
|
}
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
|_: [_; continue]| {} //~ ERROR: `continue` outside of loop
|
|_: [_; continue]| {} //~ ERROR: `continue` outside of a loop
|
||||||
//~^ ERROR mismatched types
|
//~^ ERROR mismatched types
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,14 +30,14 @@ async fn return_targets_async_block_not_async_fn() -> u8 {
|
||||||
|
|
||||||
fn no_break_in_async_block() {
|
fn no_break_in_async_block() {
|
||||||
async {
|
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() {
|
fn no_break_in_async_block_even_with_outer_loop() {
|
||||||
loop {
|
loop {
|
||||||
async {
|
async {
|
||||||
break 0u8; //~ ERROR `break` inside of an async block
|
break 0u8; //~ ERROR `break` inside of an `async` block
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
--> $DIR/async-block-control-flow-static-semantics.rs:33:9
|
||||||
|
|
|
|
||||||
LL | async {
|
LL | async {
|
||||||
|
@ -8,7 +8,7 @@ LL | | break 0u8;
|
||||||
LL | | };
|
LL | | };
|
||||||
| |_____- enclosing `async` block
|
| |_____- 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
|
--> $DIR/async-block-control-flow-static-semantics.rs:40:13
|
||||||
|
|
|
|
||||||
LL | async {
|
LL | async {
|
||||||
|
|
|
@ -7,8 +7,8 @@ fn cond() -> bool { true }
|
||||||
fn foo<F>(_: F) where F: FnOnce() {}
|
fn foo<F>(_: F) where F: FnOnce() {}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let pth = break; //~ ERROR: `break` outside of loop
|
let pth = break; //~ ERROR: `break` outside of a loop
|
||||||
if cond() { continue } //~ ERROR: `continue` outside of loop
|
if cond() { continue } //~ ERROR: `continue` outside of a loop
|
||||||
|
|
||||||
while cond() {
|
while cond() {
|
||||||
if cond() { break }
|
if cond() { break }
|
||||||
|
@ -21,5 +21,5 @@ fn main() {
|
||||||
|
|
||||||
let rs: Foo = Foo{t: pth};
|
let rs: Foo = Foo{t: pth};
|
||||||
|
|
||||||
let unconstrained = break; //~ ERROR: `break` outside of loop
|
let unconstrained = break; //~ ERROR: `break` outside of a loop
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
fn main() {
|
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
|
//~^ ERROR mismatched types
|
||||||
|
|
||||||
while |_: [_; break]| {} {} //~ ERROR: `break` outside of loop
|
while |_: [_; break]| {} {} //~ ERROR: `break` outside of a loop
|
||||||
//~^ ERROR mismatched types
|
//~^ ERROR mismatched types
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
// Make sure that a continue span actually contains the keyword.
|
// Make sure that a continue span actually contains the keyword.
|
||||||
|
|
||||||
fn main() {
|
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
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue