aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2021-01-21 15:42:56 +0000
committerJonas Schievink <[email protected]>2021-01-21 15:42:56 +0000
commit4e603b79474ee37c7f8191c5e0defc8240c11bf4 (patch)
treebf9e3bdab786891fffdaa51e98cc7ab8f6c38539 /crates
parent47a70aadcedbcf28ad6d1ea59b77bf0e11493de0 (diff)
Add test for nameres in nested blocks
Diffstat (limited to 'crates')
-rw-r--r--crates/hir_def/src/nameres/tests/block.rs29
1 files changed, 29 insertions, 0 deletions
diff --git a/crates/hir_def/src/nameres/tests/block.rs b/crates/hir_def/src/nameres/tests/block.rs
index ab7ec9d62..b6c007920 100644
--- a/crates/hir_def/src/nameres/tests/block.rs
+++ b/crates/hir_def/src/nameres/tests/block.rs
@@ -70,3 +70,32 @@ fn outer() {
70 "#]], 70 "#]],
71 ); 71 );
72} 72}
73
74#[test]
75fn nested_blocks() {
76 check_at(
77 r#"
78//- /lib.rs
79fn outer() {
80 struct inner1 {}
81 fn inner() {
82 use inner1;
83 use outer;
84 fn inner2() {}
85 $0
86 }
87}
88"#,
89 expect![[r#"
90 block scope
91 inner1: t
92 inner2: v
93 outer: v
94 block scope
95 inner: v
96 inner1: t
97 crate
98 outer: v
99 "#]],
100 );
101}