summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-05-29 18:20:15 +0800
committerJohn Hodge <tpg@mutabah.net>2016-05-29 18:20:15 +0800
commitfd9b01b2d8b1efb4f7f95a72af4eeff2fae2a576 (patch)
treed467609b48a4b82d83e739ed175817eeaadb099f /src
parentf89032cc3bb82ae691cc353ac33345bbf8a8559a (diff)
downloadmrust-fd9b01b2d8b1efb4f7f95a72af4eeff2fae2a576.tar.gz
Resolve - Fix glob imports of enums yeilding bad paths
Diffstat (limited to 'src')
-rw-r--r--src/hir_conv/bind.cpp2
-rw-r--r--src/resolve/index.cpp4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/hir_conv/bind.cpp b/src/hir_conv/bind.cpp
index a4fb4d05..4b4acf4d 100644
--- a/src/hir_conv/bind.cpp
+++ b/src/hir_conv/bind.cpp
@@ -37,7 +37,7 @@ namespace {
return &e2;
)
else {
- ERROR(sp, E0000, "Expected an enum at penultimate node of " << path << ", got a " << it->second->ent.tag_str());
+ ERROR(sp, E0000, "Expected an enum at the penultimate node of " << path << ", got a " << it->second->ent.tag_str());
}
}
else {
diff --git a/src/resolve/index.cpp b/src/resolve/index.cpp
index d3fdf57d..eeae3f5b 100644
--- a/src/resolve/index.cpp
+++ b/src/resolve/index.cpp
@@ -224,6 +224,7 @@ void Resolve_Index_Module_Wildcard(AST::Module& mod, bool handle_pub)
),
(Module,
+ DEBUG("Glob mod " << i.data.path);
if( e.module_ == &mod ) {
ERROR(sp, E0000, "Glob import of self");
}
@@ -246,9 +247,10 @@ void Resolve_Index_Module_Wildcard(AST::Module& mod, bool handle_pub)
}
),
(Enum,
+ DEBUG("Glob enum " << i.data.path);
unsigned int idx = 0;
for( const auto& ev : e.enum_->variants() ) {
- ::AST::Path p = mod.path() + ev.m_name;
+ ::AST::Path p = i.data.path + ev.m_name;
p.bind( ::AST::PathBinding::make_EnumVar({e.enum_, idx}) );
if( ev.m_data.is_Struct() ) {
_add_item_type ( sp, mod, ev.m_name, i.is_pub, mv$(p), false );