aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/module
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2018-12-09 10:22:13 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2018-12-09 10:22:13 +0000
commit77b70fcfd432a383243cd70e177b2bb30751da94 (patch)
treecde35c9e5218afd721a159f46c768641b496dd63 /crates/ra_hir/src/module
parent904438e993b4cc3c1d9269a44436c1b112de16c0 (diff)
parent159525b120121b217f2831869b6ea9a3cf9fe554 (diff)
Merge #270
270: Checks r=matklad a=matklad I see occasional panics when binding sources. Hopefully this assertions will make it clear where do the panics come from/ Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/module')
-rw-r--r--crates/ra_hir/src/module/nameres.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_hir/src/module/nameres.rs b/crates/ra_hir/src/module/nameres.rs
index 61a1acfe6..6511359d0 100644
--- a/crates/ra_hir/src/module/nameres.rs
+++ b/crates/ra_hir/src/module/nameres.rs
@@ -168,7 +168,7 @@ impl InputModuleItems {
168 } 168 }
169 169
170 fn add_use_item(&mut self, file_items: &SourceFileItems, item: ast::UseItem) { 170 fn add_use_item(&mut self, file_items: &SourceFileItems, item: ast::UseItem) {
171 let file_item_id = file_items.id_of(item.syntax()); 171 let file_item_id = file_items.id_of_unchecked(item.syntax());
172 let start_offset = item.syntax().range().start(); 172 let start_offset = item.syntax().range().start();
173 Path::expand_use_item(item, |path, range| { 173 Path::expand_use_item(item, |path, range| {
174 let kind = match range { 174 let kind = match range {
@@ -188,7 +188,7 @@ impl ModuleItem {
188 let name = item.name()?.text(); 188 let name = item.name()?.text();
189 let kind = item.syntax().kind(); 189 let kind = item.syntax().kind();
190 let vis = Vis::Other; 190 let vis = Vis::Other;
191 let id = file_items.id_of(item.syntax()); 191 let id = file_items.id_of_unchecked(item.syntax());
192 let res = ModuleItem { 192 let res = ModuleItem {
193 id, 193 id,
194 name, 194 name,