summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2019-01-20 16:47:28 +0800
committerJohn Hodge <tpg@ucc.asn.au>2019-01-20 16:47:28 +0800
commitbbeaa7a86d532e82c3218127e2833933361e3c5f (patch)
tree8d79122b8db668a576a0771871a9eeccb2cce87e
parentd750b39f37cc664ecfae0a4e823271b6cec7183b (diff)
downloadmrust-bbeaa7a86d532e82c3218127e2833933361e3c5f.tar.gz
Resolve Use - Finer-grained recursion control
-rw-r--r--src/resolve/use.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/resolve/use.cpp b/src/resolve/use.cpp
index 52a4ebb6..450af742 100644
--- a/src/resolve/use.cpp
+++ b/src/resolve/use.cpp
@@ -351,13 +351,17 @@ void Resolve_Use_Mod(const ::AST::Crate& crate, ::AST::Module& mod, ::AST::Path
DEBUG("- Named import " << imp_e.name << " = " << imp_e.path);
if( !imp_e.path.m_bindings.has_binding() ) {
DEBUG(" > Needs resolve");
- static ::std::vector<const ::AST::Module*> s_mods;
- if( ::std::find(s_mods.begin(), s_mods.end(), &mod) == s_mods.end() )
+ static ::std::vector<const ::AST::Path*> s_mods;
+ if( ::std::find(s_mods.begin(), s_mods.end(), &imp_e.path) == s_mods.end() )
{
- s_mods.push_back(&mod);
+ s_mods.push_back(&imp_e.path);
rv.merge_from( Resolve_Use_GetBinding(sp2, crate, Resolve_Use_AbsolutisePath(sp2, mod.path(), imp_e.path), parent_modules) );
s_mods.pop_back();
}
+ else
+ {
+ DEBUG("Recursion!");
+ }
}
else {
//out_path = imp_e.path;
@@ -799,6 +803,7 @@ namespace {
else
{
const auto& enum_ = *e.enum_;
+ is_value = false;
for( const auto& var : enum_.variants() )
{
if( var.m_name == node2.name() ) {