summaryrefslogtreecommitdiff
path: root/src/resolve
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-10-26 18:17:16 +0800
committerJohn Hodge <tpg@mutabah.net>2016-10-26 18:17:16 +0800
commit3168dfe866620f3c68e37c1ac2838af0ee1bda8d (patch)
tree75710573cc3e08d9136cbb28884fc4e0e8c3cfcf /src/resolve
parented7017e42e6a36f5ab24ed970f5c743187f2c012 (diff)
downloadmrust-3168dfe866620f3c68e37c1ac2838af0ee1bda8d.tar.gz
Resolve Use - Fix alternate binding code
Diffstat (limited to 'src/resolve')
-rw-r--r--src/resolve/absolute.cpp2
-rw-r--r--src/resolve/use.cpp10
2 files changed, 7 insertions, 5 deletions
diff --git a/src/resolve/absolute.cpp b/src/resolve/absolute.cpp
index 1077702a..d8b167c4 100644
--- a/src/resolve/absolute.cpp
+++ b/src/resolve/absolute.cpp
@@ -420,7 +420,7 @@ struct Context
}
// Top-level module
- DEBUG("- Top module");
+ DEBUG("- Top module (" << m_mod.path() << ")");
::AST::Path rv;
if( this->lookup_in_mod(m_mod, name, mode, rv) ) {
return rv;
diff --git a/src/resolve/use.cpp b/src/resolve/use.cpp
index e8a8c4e3..7063e7f0 100644
--- a/src/resolve/use.cpp
+++ b/src/resolve/use.cpp
@@ -88,7 +88,8 @@ void Resolve_Use(::AST::Crate& crate)
void Resolve_Use_Mod(const ::AST::Crate& crate, ::AST::Module& mod, ::AST::Path path, slice< const ::AST::Module* > parent_modules)
{
- //TRACE_FUNCTION_F("path = " << path << ", mod.path() = " << mod.path());
+ TRACE_FUNCTION_F("path = " << path);
+
for(auto& use_stmt : mod.items())
{
if( ! use_stmt.data.is_Use() )
@@ -143,8 +144,8 @@ void Resolve_Use_Mod(const ::AST::Crate& crate, ::AST::Module& mod, ::AST::Path
case ::AST::PathBinding::TAG_Function:
allow = Lookup::Type;
break;
- default:
- break;
+ // DEAD, Unbound, ...
+ default: break;
}
ASSERT_BUG(span, allow != Lookup::Any, "");
use_stmt_data.alt_binding = Resolve_Use_GetBinding(span, crate, use_stmt_data.path, parent_modules, allow);
@@ -271,6 +272,8 @@ void Resolve_Use_Mod(const ::AST::Crate& crate, ::AST::Module& mod, ::AST::Path
continue ;
if( item.name == des_item_name ) {
+ //if( allow != Lookup::Any )
+ // DEBUG(mod.path() << " " << des_item_name << " " << item.data.tag_str());
TU_MATCH(::AST::Item, (item.data), (e),
(None,
// IMPOSSIBLE - Handled above
@@ -326,7 +329,6 @@ void Resolve_Use_Mod(const ::AST::Crate& crate, ::AST::Module& mod, ::AST::Path
return ::AST::PathBinding::make_Module({&e});
)
)
- break ;
}
}