mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
Allow break
and co to go through try{}
blocks
This commit is contained in:
parent
16264a3a53
commit
eecab99dec
2 changed files with 19 additions and 23 deletions
|
@ -37,28 +37,6 @@ fn foo() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn try_blocks_are_borders() {
|
||||
check_diagnostics(
|
||||
r#"
|
||||
fn foo() {
|
||||
'a: loop {
|
||||
try {
|
||||
break;
|
||||
//^^^^^ error: break outside of loop
|
||||
break 'a;
|
||||
//^^^^^^^^ error: break outside of loop
|
||||
continue;
|
||||
//^^^^^^^^ error: continue outside of loop
|
||||
continue 'a;
|
||||
//^^^^^^^^^^^ error: continue outside of loop
|
||||
};
|
||||
}
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn async_blocks_are_borders() {
|
||||
check_diagnostics(
|
||||
|
@ -121,6 +99,24 @@ fn foo() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn try_blocks_pass_through() {
|
||||
check_diagnostics(
|
||||
r#"
|
||||
fn foo() {
|
||||
'a: loop {
|
||||
try {
|
||||
break;
|
||||
break 'a;
|
||||
continue;
|
||||
continue 'a;
|
||||
};
|
||||
}
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn label_blocks() {
|
||||
check_diagnostics(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue