mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Fix for-loop expressions breaking with BlockExpr iterable
This commit is contained in:
parent
b9fa37f5b4
commit
c93983e76f
4 changed files with 44 additions and 5 deletions
|
@ -1221,3 +1221,27 @@ fn mamba(a: U32!(), p: u32) -> u32 {
|
|||
"#,
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn for_loop_block_expr_iterable() {
|
||||
check_infer(
|
||||
r#"
|
||||
fn test() {
|
||||
for _ in { let x = 0; } {
|
||||
let y = 0;
|
||||
}
|
||||
}
|
||||
"#,
|
||||
expect![[r#"
|
||||
10..68 '{ ... } }': ()
|
||||
16..66 'for _ ... }': ()
|
||||
20..21 '_': {unknown}
|
||||
25..39 '{ let x = 0; }': ()
|
||||
31..32 'x': i32
|
||||
35..36 '0': i32
|
||||
40..66 '{ ... }': ()
|
||||
54..55 'y': i32
|
||||
58..59 '0': i32
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue