diff options
| author | Jared Roesch <roeschinc@gmail.com> | 2015-07-25 22:17:43 -0700 |
|---|---|---|
| committer | Jared Roesch <roeschinc@gmail.com> | 2015-08-04 16:05:07 -0700 |
| commit | 8602a7d89843dcd7d41d2bb569817ddb760dbf7e (patch) | |
| tree | 9ca93f9ac0db3af71b79a0134deee6f73c6f00fc /src/libsyntax/ext | |
| parent | 9fb11fe9f21051f4f03da55f949de402e78a95d5 (diff) | |
| download | rust-8602a7d89843dcd7d41d2bb569817ddb760dbf7e.tar.gz rust-8602a7d89843dcd7d41d2bb569817ddb760dbf7e.zip | |
Update and add test case
Test case from here: https://github.com/freebroccolo/rust/commit/9e93fef3c0e61836a8b56f727eb7a2e94bb4ca09
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/base.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index 28c7ead20bc..1b5dcf64833 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -416,19 +416,22 @@ impl DummyResult { pub fn raw_ty(sp: Span) -> P<ast::Ty> { P(ast::Ty { - id: ast:DUMMY_NODE_ID, + id: ast::DUMMY_NODE_ID, node: ast::TyInfer, span: sp }) + } } impl MacResult for DummyResult { fn make_expr(self: Box<DummyResult>) -> Option<P<ast::Expr>> { Some(DummyResult::raw_expr(self.span)) } + fn make_pat(self: Box<DummyResult>) -> Option<P<ast::Pat>> { Some(P(DummyResult::raw_pat(self.span))) } + fn make_items(self: Box<DummyResult>) -> Option<SmallVector<P<ast::Item>>> { // this code needs a comment... why not always just return the Some() ? if self.expr_only { @@ -437,6 +440,7 @@ impl MacResult for DummyResult { Some(SmallVector::zero()) } } + fn make_impl_items(self: Box<DummyResult>) -> Option<SmallVector<P<ast::ImplItem>>> { if self.expr_only { None @@ -444,6 +448,7 @@ impl MacResult for DummyResult { Some(SmallVector::zero()) } } + fn make_stmts(self: Box<DummyResult>) -> Option<SmallVector<P<ast::Stmt>>> { Some(SmallVector::one(P( codemap::respan(self.span, |
