summaryrefslogtreecommitdiff
path: root/src/convert/resolve.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-01-30 12:24:35 +0800
committerJohn Hodge <tpg@mutabah.net>2016-01-30 12:24:35 +0800
commit48eec4328930a9bd6084f95fd79257068d738c91 (patch)
tree1fde3ccf5bc0832ad8b7bc82043be3d052258abc /src/convert/resolve.cpp
parent6a33c8092abfc0fa9b87951667b9e0da8fd9b047 (diff)
downloadmrust-48eec4328930a9bd6084f95fd79257068d738c91.tar.gz
Build fixes
Diffstat (limited to 'src/convert/resolve.cpp')
-rw-r--r--src/convert/resolve.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/convert/resolve.cpp b/src/convert/resolve.cpp
index 995ab13c..d1463c8c 100644
--- a/src/convert/resolve.cpp
+++ b/src/convert/resolve.cpp
@@ -1524,10 +1524,16 @@ void CPathResolver::handle_function(AST::Path path, AST::Function& fcn)
}
-void absolutise_path(const Span& span, const AST::Crate& crate, const AST::Path& modpath, AST::Path& path)
+void absolutise_path(const Span& span, const AST::Crate& crate, const AST::Module& mod, const AST::Path& modpath, AST::Path& path)
{
// TODO: Should this code resolve encountered use statements into the real path?
TU_MATCH(AST::Path::Class, (path.m_class), (info),
+ (Invalid,
+ BUG(span, "Invalid path type encountered - Class::Invalid");
+ ),
+ (Local,
+ // Known-local paths don't need to be absolutised
+ ),
(Absolute,
// Nothing needs to be done
),
@@ -1556,7 +1562,7 @@ void absolutise_path(const Span& span, const AST::Crate& crate, const AST::Path&
auto newpath = modpath_tmp + path;
DEBUG("Absolutised path " << path << " into " << newpath);
path = ::std::move(newpath);
- )
+ ),
(Relative,
auto newpath = modpath + path;
DEBUG("Absolutised path " << path << " into " << newpath);
@@ -1576,7 +1582,7 @@ void ResolvePaths_HandleModule_Use(const AST::Crate& crate, const AST::Path& mod
{
const Span span = Span();
DEBUG("p = " << imp.data);
- absolutise_path(span, crate, modpath, imp.data);
+ absolutise_path(span, crate, mod, modpath, imp.data);
resolve_path(span, crate, imp.data);
DEBUG("Resolved import : " << imp.data);