diff options
author | John Hodge <tpg@mutabah.net> | 2016-10-30 19:06:02 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-10-30 19:06:02 +0800 |
commit | 49c99b869f9745a29b2081b52307a8451edbca4c (patch) | |
tree | 92f54bbd5aca8b57b5bccc6a7037c6f62d275023 /src/mir/from_hir.cpp | |
parent | e9fae2ebcd43b249e09079b0596e3338a04e1c99 (diff) | |
download | mrust-49c99b869f9745a29b2081b52307a8451edbca4c.tar.gz |
MIR Gen - Allow field accesses on rvalues
Diffstat (limited to 'src/mir/from_hir.cpp')
-rw-r--r-- | src/mir/from_hir.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/mir/from_hir.cpp b/src/mir/from_hir.cpp index 80915304..a2faeeb5 100644 --- a/src/mir/from_hir.cpp +++ b/src/mir/from_hir.cpp @@ -1380,9 +1380,7 @@ namespace { { TRACE_FUNCTION_F("_Field"); this->visit_node_ptr(node.m_value); - // TODO: What if this is called as `(1, 2, 3).0` - // - NOTE: `rustc` accepts the above - even for assignments. So `get_result_in_lvalue` is likely more correct - auto val = m_builder.get_result_unwrap_lvalue(node.m_value->span()); + auto val = m_builder.get_result_in_lvalue(node.m_value->span(), node.m_value->m_res_type); unsigned int idx; if( '0' <= node.m_field[0] && node.m_field[0] <= '9' ) { |