mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
fix: Fix expression scopes not being calculated for inline consts
This commit is contained in:
parent
ec941e599a
commit
ac389ce2ef
7 changed files with 69 additions and 34 deletions
|
@ -3664,3 +3664,21 @@ fn main() {
|
|||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn inline_const_expression() {
|
||||
check(
|
||||
r#"
|
||||
fn main() {
|
||||
let foo = 0;
|
||||
const {
|
||||
let bar = 1;
|
||||
let unresolved = foo;
|
||||
// ^^^^^^^^^^ type: {unknown}
|
||||
let resolved = bar;
|
||||
// ^^^^^^^^ type: i32
|
||||
}
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue