summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-07-11 18:18:23 +1000
committerJohn Hodge <tpg@mutabah.net>2016-07-11 18:18:23 +1000
commit765c4a43dadaff1d31ea22db45ec54e5c7fe6290 (patch)
tree5610f6ae81a186cde965ea195b13c70046c4d754 /src
parent5971170b5dd1733c2a8e4eb895d68089fec877d3 (diff)
downloadmrust-765c4a43dadaff1d31ea22db45ec54e5c7fe6290.tar.gz
Expand derive - Fix some broken cases
Diffstat (limited to 'src')
-rw-r--r--src/expand/derive.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/expand/derive.cpp b/src/expand/derive.cpp
index b1951ea8..e50d881b 100644
--- a/src/expand/derive.cpp
+++ b/src/expand/derive.cpp
@@ -374,7 +374,7 @@ public:
(Tuple,
for( unsigned int idx = 0; idx < e.ents.size(); idx ++ )
{
- nodes.push_back( this->assert_is_eq(assert_method_path, this->field(FMT("idx"))) );
+ nodes.push_back( this->assert_is_eq(assert_method_path, this->field(FMT(idx))) );
}
)
)
@@ -439,11 +439,7 @@ public:
)
::std::vector< AST::Pattern> pats;
- {
- ::std::vector< AST::Pattern> tuple_pats;
- tuple_pats.push_back( AST::Pattern(AST::Pattern::TagReference(), mv$(pat_a)) );
- pats.push_back( AST::Pattern(AST::Pattern::TagTuple(), mv$(tuple_pats)) );
- }
+ pats.push_back( AST::Pattern(AST::Pattern::TagReference(), mv$(pat_a)) );
arms.push_back(AST::ExprNode_Match_Arm(
mv$(pats),
@@ -453,7 +449,7 @@ public:
}
return this->make_ret(sp, p, type, NEWNODE(AST::ExprNode_Match,
- NEWNODE(AST::ExprNode_Deref, NEWNODE(AST::ExprNode_NamedValue, AST::Path("self"))),
+ NEWNODE(AST::ExprNode_NamedValue, AST::Path("self")),
mv$(arms)
));
}