mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-12 21:28:51 +00:00
Merge #7376
7376: Add test for nameres in nested blocks r=jonas-schievink a=jonas-schievink bors r+ Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
This commit is contained in:
commit
235583f3fc
1 changed files with 29 additions and 0 deletions
|
@ -70,3 +70,32 @@ fn outer() {
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn nested_blocks() {
|
||||||
|
check_at(
|
||||||
|
r#"
|
||||||
|
//- /lib.rs
|
||||||
|
fn outer() {
|
||||||
|
struct inner1 {}
|
||||||
|
fn inner() {
|
||||||
|
use inner1;
|
||||||
|
use outer;
|
||||||
|
fn inner2() {}
|
||||||
|
$0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"#,
|
||||||
|
expect![[r#"
|
||||||
|
block scope
|
||||||
|
inner1: t
|
||||||
|
inner2: v
|
||||||
|
outer: v
|
||||||
|
block scope
|
||||||
|
inner: v
|
||||||
|
inner1: t
|
||||||
|
crate
|
||||||
|
outer: v
|
||||||
|
"#]],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue