diff options
author | John Hodge <tpg@mutabah.net> | 2016-09-28 20:36:24 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-09-28 20:36:24 +0800 |
commit | e80c6c12e6a09773b152c268c090aa09d0fc7701 (patch) | |
tree | 1c3109d9d88af6cb7eff785394aa2a993d562252 | |
parent | f749f53986f7a0a78949d62d7ee39905899c61d5 (diff) | |
download | mrust-e80c6c12e6a09773b152c268c090aa09d0fc7701.tar.gz |
Const Eval - Fix dumb bug in call
-rw-r--r-- | src/hir_conv/constant_evaluation.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/hir_conv/constant_evaluation.cpp b/src/hir_conv/constant_evaluation.cpp index 6ecbfbc7..b133fbc9 100644 --- a/src/hir_conv/constant_evaluation.cpp +++ b/src/hir_conv/constant_evaluation.cpp @@ -448,7 +448,7 @@ namespace { { const auto& pattern = fcn.m_args[i].first; node.m_args[i]->visit(*this); - args.push_back( mv$(args) ); + args.push_back( mv$(m_rv) ); TU_IFLET(::HIR::Pattern::Data, pattern.m_data, Any, e, // Good ) @@ -459,7 +459,7 @@ namespace { // Call by invoking evaluate_constant on the function { - TRACE_FUNCTION_F("Call const fn " << node.m_path); + TRACE_FUNCTION_F("Call const fn " << node.m_path << " args={ " << args << " }"); m_rv = evaluate_constant(node.span(), m_crate, m_newval_state, fcn.m_code, mv$(args)); } } @@ -753,7 +753,8 @@ namespace { TODO(sp, "RValue::Borrow"); ), (Cast, - TODO(sp, "RValue::Cast"); + auto inval = read_lval(e.val); + TODO(sp, "RValue::Cast to " << e.type << ", val = " << inval); ), (BinOp, TODO(sp, "RValue::BinOp"); @@ -820,7 +821,7 @@ namespace { // Call by invoking evaluate_constant on the function { - TRACE_FUNCTION_F("Call const fn " << fcnp); + TRACE_FUNCTION_F("Call const fn " << fcnp << " args={ " << call_args << " }"); dst = evaluate_constant(sp, crate, newval_state, fcn.m_code, mv$(call_args)); } |