diff options
author | John Hodge <tpg@mutabah.net> | 2016-11-26 10:51:11 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-11-26 10:51:11 +0800 |
commit | 3db52a81d3891ff7030d622fd2f364cafa29c278 (patch) | |
tree | 159dbe24a4079f3f9f78f7dd0f234ae6bd7df207 /src | |
parent | 5bbb91227cc33fcd593178bebc588d4a389d37bc (diff) | |
download | mrust-3db52a81d3891ff7030d622fd2f364cafa29c278.tar.gz |
HIR Annotate - Fix annotation on CallValue arguments
Diffstat (limited to 'src')
-rw-r--r-- | src/hir_expand/annotate_value_usage.cpp | 7 | ||||
-rw-r--r-- | src/hir_expand/closures.cpp | 2 | ||||
-rw-r--r-- | src/mir/mir_builder.cpp | 2 |
3 files changed, 8 insertions, 3 deletions
diff --git a/src/hir_expand/annotate_value_usage.cpp b/src/hir_expand/annotate_value_usage.cpp index 08c35492..2634920e 100644 --- a/src/hir_expand/annotate_value_usage.cpp +++ b/src/hir_expand/annotate_value_usage.cpp @@ -302,9 +302,12 @@ namespace { vu = ::HIR::ValueUsage::Move; break; } - auto _ = push_usage( vu ); + { + auto _ = push_usage( vu ); + this->visit_node_ptr(node.m_value); + } - this->visit_node_ptr(node.m_value); + auto _ = push_usage( ::HIR::ValueUsage::Move ); for( auto& val : node.m_args ) this->visit_node_ptr(val); } diff --git a/src/hir_expand/closures.cpp b/src/hir_expand/closures.cpp index 9ffcf4de..86811a5e 100644 --- a/src/hir_expand/closures.cpp +++ b/src/hir_expand/closures.cpp @@ -453,6 +453,7 @@ namespace { // --- Apply the capture set for this closure to the parent --- if( m_closure_stack.size() > 0 ) { + DEBUG("> Apply to parent"); for(const auto& cap : ent.captured_vars) { mark_used_variable(node.span(), cap.first, cap.second); @@ -784,6 +785,7 @@ namespace { { if( !m_closure_stack.empty() ) { + TRACE_FUNCTION_F("_CallValue"); if( node.m_trait_used == ::HIR::ExprNode_CallValue::TraitUsed::Unknown ) { if( node.m_res_type.m_data.is_Closure() ) diff --git a/src/mir/mir_builder.cpp b/src/mir/mir_builder.cpp index 9c241339..202daac0 100644 --- a/src/mir/mir_builder.cpp +++ b/src/mir/mir_builder.cpp @@ -1113,7 +1113,7 @@ void MirBuilder::moved_lvalue(const Span& sp, const ::MIR::LValue& lv) return ; } } - BUG(sp, "Move out of deref with non-Copy values - &move? - " << lv); + BUG(sp, "Move out of deref with non-Copy values - &move? - " << lv << " : " << FMT_CB(ss, this->with_val_type(sp, lv, [&](const auto& ty){ss<<ty;});) ); moved_lvalue(sp, *e.val); } ), |