mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
Fix body selection in while loops
This commit is contained in:
parent
a2cc1d6b7b
commit
87c4a4104d
4 changed files with 34 additions and 3 deletions
|
@ -1245,3 +1245,25 @@ fn test() {
|
|||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn while_loop_block_expr_iterable() {
|
||||
check_infer(
|
||||
r#"
|
||||
fn test() {
|
||||
while { true } {
|
||||
let y = 0;
|
||||
}
|
||||
}
|
||||
"#,
|
||||
expect![[r#"
|
||||
10..59 '{ ... } }': ()
|
||||
16..57 'while ... }': ()
|
||||
22..30 '{ true }': bool
|
||||
24..28 'true': bool
|
||||
31..57 '{ ... }': ()
|
||||
45..46 'y': i32
|
||||
49..50 '0': i32
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue