diff options
-rw-r--r-- | crates/hir_def/src/nameres/tests/block.rs | 29 |
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] | ||
75 | fn nested_blocks() { | ||
76 | check_at( | ||
77 | r#" | ||
78 | //- /lib.rs | ||
79 | fn 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 | } | ||