summaryrefslogtreecommitdiff
path: root/src/resolve
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-11-23 11:15:21 +0800
committerJohn Hodge <tpg@mutabah.net>2016-11-23 11:15:21 +0800
commit5bc5d0122bf5f38ef394b9f3363995193c476530 (patch)
tree07a9a1dc8be408768acc45b39a03a703cbc074d6 /src/resolve
parent4fbd4d8d838e8c74ac44b388053a2fc69721395f (diff)
downloadmrust-5bc5d0122bf5f38ef394b9f3363995193c476530.tar.gz
Resolve Index - Handle paths pointing to crate roots
Diffstat (limited to 'src/resolve')
-rw-r--r--src/resolve/index.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/resolve/index.cpp b/src/resolve/index.cpp
index c65327b0..71da3b4e 100644
--- a/src/resolve/index.cpp
+++ b/src/resolve/index.cpp
@@ -535,6 +535,10 @@ void Resolve_Index_Module_Normalise_Path_ext(const ::AST::Crate& crate, const Sp
if( item_ptr->is_Import() ) {
const auto& e = item_ptr->as_Import();
const auto& ec = crate.m_extern_crates.at( e.path.m_crate_name );
+ if( e.path.m_components.size() == 0 ) {
+ hmod = &ec.m_hir->m_root_module;
+ continue ;
+ }
item_ptr = &ec.m_hir->get_typeitem_by_path(sp, e.path, true); // ignore_crate_name=true
}
TU_MATCH_DEF(::HIR::TypeItem, (*item_ptr), (e),