diff options
author | John Hodge <tpg@mutabah.net> | 2016-09-11 16:42:05 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-09-11 16:42:05 +0800 |
commit | f9c52efa3d2226f752aee546aaf849fb4c6a7c85 (patch) | |
tree | c0d042e08ac8411e37969096f3d82632d85f0d72 /src | |
parent | 09b562021cd873625fd25b98b508e853ba47d879 (diff) | |
download | mrust-f9c52efa3d2226f752aee546aaf849fb4c6a7c85.tar.gz |
Resolve Use - Replace bug with a TODO
Diffstat (limited to 'src')
-rw-r--r-- | src/resolve/use.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/resolve/use.cpp b/src/resolve/use.cpp index 18a8fb94..216ab24b 100644 --- a/src/resolve/use.cpp +++ b/src/resolve/use.cpp @@ -307,7 +307,7 @@ void Resolve_Use_Mod(const ::AST::Crate& crate, ::AST::Module& mod, ::AST::Path return Resolve_Use_GetBinding(sp2, crate, Resolve_Use_AbsolutisePath(sp2, mod.path(), imp.data.path), parent_modules, allow); } else { - if( allow != Lookup::Any ) + if( allow != Lookup::Any && allow != Lookup::AnyOpt ) { switch( imp.data.path.binding().tag() ) { @@ -336,6 +336,7 @@ void Resolve_Use_Mod(const ::AST::Crate& crate, ::AST::Module& mod, ::AST::Path } } if( imp.is_pub && imp.name == "" ) { + DEBUG("- Search glob of " << imp.data.path); // INEFFICIENT! Resolves and throws away the result (because we can't/shouldn't mutate here) ::AST::PathBinding binding_; const auto* binding = &imp.data.path.binding(); @@ -516,11 +517,18 @@ void Resolve_Use_Mod(const ::AST::Crate& crate, ::AST::Module& mod, ::AST::Path return ::AST::PathBinding::make_EnumVar({&enum_, static_cast<unsigned int>(variant_index)}); ), (Module, + ASSERT_BUG(span, e.module_ || e.hir, "nullptr module pointer in node " << i << " of " << path); + if( !e.module_ ) + { + assert(e.hir); + TODO(span, "Look up the remainder of " << path << " from " << i << " in HIR"); + } mod = e.module_; ) ) } + assert(mod); return Resolve_Use_GetBinding_Mod(span, crate, *mod, nodes.back().name(), parent_modules, allow); } |