summaryrefslogtreecommitdiff
path: root/src/hir_expand/ufcs_everything.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-08-17 12:28:49 +0800
committerJohn Hodge <tpg@mutabah.net>2016-08-17 12:28:49 +0800
commitd31c674953f0d17f2fbcdc6087003259f363b271 (patch)
tree90677629adbd28e13dc93dce14ae841802c873d1 /src/hir_expand/ufcs_everything.cpp
parent9faf10162f9f52201cdf1fa60248139037d615c4 (diff)
downloadmrust-d31c674953f0d17f2fbcdc6087003259f363b271.tar.gz
HIR - Correct closure desugaring (leads to two equivalent types)
Diffstat (limited to 'src/hir_expand/ufcs_everything.cpp')
-rw-r--r--src/hir_expand/ufcs_everything.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/hir_expand/ufcs_everything.cpp b/src/hir_expand/ufcs_everything.cpp
index 6e7b42e5..91b6aaa3 100644
--- a/src/hir_expand/ufcs_everything.cpp
+++ b/src/hir_expand/ufcs_everything.cpp
@@ -36,6 +36,8 @@ namespace {
root->visit(*this);
if( m_replacement ) {
auto usage = root->m_usage;
+ const auto* ptr = m_replacement.get();
+ DEBUG("=> REPLACE " << ptr << " " << typeid(*ptr).name());
root.reset( m_replacement.release() );
root->m_usage = usage;
}
@@ -49,6 +51,8 @@ namespace {
node->visit(*this);
if( m_replacement ) {
auto usage = node->m_usage;
+ const auto* ptr = m_replacement.get();
+ DEBUG("=> REPLACE " << ptr << " " << typeid(*ptr).name());
node = mv$(m_replacement);
node->m_usage = usage;
}
@@ -74,8 +78,8 @@ namespace {
::HIR::TypeRef arg_tup_type;
{
::std::vector< ::HIR::TypeRef> arg_types;
- for(unsigned int i = 0; i < node.m_arg_types.size() - 1; i ++)
- arg_types.push_back( node.m_arg_types[i].clone() );
+ for(unsigned int i = 0; i < node.m_args.size(); i ++)
+ arg_types.push_back( node.m_args[i]->m_res_type.clone() );
arg_tup_type = ::HIR::TypeRef( mv$(arg_types) );
}
// - Make the trait arguments.