diff options
author | John Hodge <tpg@mutabah.net> | 2016-11-08 10:06:13 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-11-08 10:06:13 +0800 |
commit | a357c00537622cbf1d62833b3fdefb3a83006ec1 (patch) | |
tree | 52440008bb542102de297fd56dbc909501636031 /src/resolve | |
parent | 1b730b5e4e1aff438d07f60e0790894ee125fca3 (diff) | |
download | mrust-a357c00537622cbf1d62833b3fdefb3a83006ec1.tar.gz |
Resolve Use - Handle imports of a crate root
Diffstat (limited to 'src/resolve')
-rw-r--r-- | src/resolve/use.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/resolve/use.cpp b/src/resolve/use.cpp index 89957696..b376e21f 100644 --- a/src/resolve/use.cpp +++ b/src/resolve/use.cpp @@ -577,6 +577,8 @@ namespace { const auto& enm = ec.m_hir->get_typeitem_by_path(span, p, true).as_Enum(); return ::AST::PathBinding::make_EnumVar({ nullptr, e.idx, &enm }); } + if( e.path.m_components.empty() ) + return ::AST::PathBinding::make_Module({nullptr, &ec.m_hir->m_root_module}); item_ptr = &ec.m_hir->get_typeitem_by_path(span, e.path, true); // ignore_crate_name=true } TU_MATCHA( (*item_ptr), (e), |