aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-01-21 15:43:53 +0000
committerGitHub <[email protected]>2021-01-21 15:43:53 +0000
commit235583f3fc886bb839f34c4ff5713d101939d95c (patch)
treebf9e3bdab786891fffdaa51e98cc7ab8f6c38539 /crates/hir_def/src
parent47a70aadcedbcf28ad6d1ea59b77bf0e11493de0 (diff)
parent4e603b79474ee37c7f8191c5e0defc8240c11bf4 (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')
-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}