mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 21:43:37 +00:00
Add test for nameres in nested blocks
This commit is contained in:
parent
47a70aadce
commit
4e603b7947
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