summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-09-23 09:57:06 +0800
committerJohn Hodge <tpg@mutabah.net>2016-09-23 09:57:06 +0800
commitf8471947dfc2705a6bd4b74dd7f33125d67fc527 (patch)
tree9299d9fd71a9fa6e81cb604932ada8271a484ba0
parent7ce59f22a7f63cdd0a3e21c722e6b71eb31936ab (diff)
downloadmrust-f8471947dfc2705a6bd4b74dd7f33125d67fc527.tar.gz
Resolve Absolute - Preserve type arguments when an import is directly replaced (e.g. mem::transmute->intrinsics::transmute)
-rw-r--r--src/resolve/absolute.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/resolve/absolute.cpp b/src/resolve/absolute.cpp
index 013ac8a3..64c446ee 100644
--- a/src/resolve/absolute.cpp
+++ b/src/resolve/absolute.cpp
@@ -659,6 +659,7 @@ namespace {
void Resolve_Absolute_Path_BindAbsolute__hir_from_import(Context& context, const Span& sp, bool is_value, AST::Path& path, const ::HIR::SimplePath& p)
{
+ TRACE_FUNCTION_FR("path="<<path<<", p="<<p, path);
const auto& ext_crate = context.m_crate.m_extern_crates.at(p.m_crate_name);
const ::HIR::Module* hmod = &ext_crate.m_hir->m_root_module;
for(unsigned int i = 0; i < p.m_components.size() - 1; i ++)
@@ -720,6 +721,7 @@ namespace {
rv.nodes().reserve( p.m_components.size() );
for(const auto& c : p.m_components)
rv.nodes().push_back( AST::PathNode(c) );
+ rv.nodes().back().args() = mv$( path.nodes().back().args() );
rv.bind( mv$(pb) );
path = mv$(rv);
}