aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_def')
-rw-r--r--crates/hir_def/src/body/tests/block.rs10
-rw-r--r--crates/hir_def/src/nameres.rs1
2 files changed, 11 insertions, 0 deletions
diff --git a/crates/hir_def/src/body/tests/block.rs b/crates/hir_def/src/body/tests/block.rs
index d5f3ac4c5..062560a70 100644
--- a/crates/hir_def/src/body/tests/block.rs
+++ b/crates/hir_def/src/body/tests/block.rs
@@ -14,6 +14,7 @@ fn outer() {
14 expect![[r#" 14 expect![[r#"
15 block scope 15 block scope
16 inner: v 16 inner: v
17
17 crate 18 crate
18 inner: t 19 inner: t
19 outer: v 20 outer: v
@@ -38,6 +39,7 @@ fn outer() {
38 CrateStruct: t v 39 CrateStruct: t v
39 SelfStruct: t v 40 SelfStruct: t v
40 Struct: t v 41 Struct: t v
42
41 crate 43 crate
42 Struct: t v 44 Struct: t v
43 outer: v 45 outer: v
@@ -62,6 +64,7 @@ fn outer() {
62 block scope 64 block scope
63 imported: t v 65 imported: t v
64 name: v 66 name: v
67
65 crate 68 crate
66 name: t 69 name: t
67 outer: v 70 outer: v
@@ -88,9 +91,11 @@ fn outer() {
88 inner1: t 91 inner1: t
89 inner2: v 92 inner2: v
90 outer: v 93 outer: v
94
91 block scope 95 block scope
92 inner: v 96 inner: v
93 inner1: t 97 inner1: t
98
94 crate 99 crate
95 outer: v 100 outer: v
96 "#]], 101 "#]],
@@ -113,6 +118,7 @@ struct Struct {}
113 expect![[r#" 118 expect![[r#"
114 block scope 119 block scope
115 Struct: t 120 Struct: t
121
116 crate 122 crate
117 Struct: t 123 Struct: t
118 module: t 124 module: t
@@ -143,6 +149,7 @@ fn f() {
143 expect![[r#" 149 expect![[r#"
144 block scope 150 block scope
145 Hit: t 151 Hit: t
152
146 crate 153 crate
147 f: v 154 f: v
148 "#]], 155 "#]],
@@ -177,8 +184,10 @@ pub mod mark {
177 expect![[r#" 184 expect![[r#"
178 block scope 185 block scope
179 Hit: t 186 Hit: t
187
180 block scope 188 block scope
181 nested: v 189 nested: v
190
182 crate 191 crate
183 f: v 192 f: v
184 mark: t 193 mark: t
@@ -210,6 +219,7 @@ fn f() {
210 expect![[r#" 219 expect![[r#"
211 block scope 220 block scope
212 Def: t 221 Def: t
222
213 crate 223 crate
214 module: t 224 module: t
215 225
diff --git a/crates/hir_def/src/nameres.rs b/crates/hir_def/src/nameres.rs
index ef54f7d08..c858ea0c4 100644
--- a/crates/hir_def/src/nameres.rs
+++ b/crates/hir_def/src/nameres.rs
@@ -324,6 +324,7 @@ impl DefMap {
324 let mut current_map = self; 324 let mut current_map = self;
325 while let Some(block) = &current_map.block { 325 while let Some(block) = &current_map.block {
326 go(&mut buf, current_map, "block scope", current_map.root); 326 go(&mut buf, current_map, "block scope", current_map.root);
327 buf.push('\n');
327 current_map = &*block.parent; 328 current_map = &*block.parent;
328 } 329 }
329 go(&mut buf, current_map, "crate", current_map.root); 330 go(&mut buf, current_map, "crate", current_map.root);