diff options
author | John Hodge <tpg@mutabah.net> | 2016-11-05 12:56:56 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-11-05 12:56:56 +0800 |
commit | 005933865519122f27d5ee9367401c65f405ae7e (patch) | |
tree | 8a6cf4c756c5b95fc2b82cb6cd11bc4e760f2262 /src | |
parent | 5ee446c95dd36027aed5256d0505715df0438338 (diff) | |
download | mrust-005933865519122f27d5ee9367401c65f405ae7e.tar.gz |
HIR Expand Reborrow - Reborrow in struct literals
Diffstat (limited to 'src')
-rw-r--r-- | src/hir_expand/reborrow.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/hir_expand/reborrow.cpp b/src/hir_expand/reborrow.cpp index 3bc89be9..680486a2 100644 --- a/src/hir_expand/reborrow.cpp +++ b/src/hir_expand/reborrow.cpp @@ -106,6 +106,19 @@ namespace { arg = do_reborrow(mv$(arg)); } } + + void visit(::HIR::ExprNode_TupleVariant& node) override { + ::HIR::ExprVisitorDef::visit(node); + for(auto& arg : node.m_args) { + arg = do_reborrow(mv$(arg)); + } + } + void visit(::HIR::ExprNode_StructLiteral& node) override { + ::HIR::ExprVisitorDef::visit(node); + for(auto& arg : node.m_values) { + arg.second = do_reborrow(mv$(arg.second)); + } + } }; class OuterVisitor: public ::HIR::Visitor |