diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-01-21 15:43:53 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-01-21 15:43:53 +0000 |
commit | 235583f3fc886bb839f34c4ff5713d101939d95c (patch) | |
tree | bf9e3bdab786891fffdaa51e98cc7ab8f6c38539 /crates/hir_def/src/nameres | |
parent | 47a70aadcedbcf28ad6d1ea59b77bf0e11493de0 (diff) | |
parent | 4e603b79474ee37c7f8191c5e0defc8240c11bf4 (diff) |
Merge #7376
7376: Add test for nameres in nested blocks r=jonas-schievink a=jonas-schievink
bors r+
Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/hir_def/src/nameres')
-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 | } | ||