Skip to content

Commit 9d5ec04

Browse files
huonwalexcrichton
authored andcommitted
syntax: fix quote_pat! & unignore a quotation test.
1 parent c9f3f47 commit 9d5ec04

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/libsyntax/ext/quote.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,7 @@ pub fn expand_quote_pat(cx: &mut ExtCtxt,
368368
sp: Span,
369369
tts: &[ast::TokenTree])
370370
-> Box<base::MacResult> {
371-
let e_refutable = cx.expr_lit(sp, ast::LitBool(true));
372-
let expanded = expand_parse_call(cx, sp, "parse_pat",
373-
vec!(e_refutable), tts);
371+
let expanded = expand_parse_call(cx, sp, "parse_pat", vec!(), tts);
374372
base::MacExpr::new(expanded)
375373
}
376374

src/test/run-pass-fulldeps/quote-tokens.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// ignore-test
12-
1311
#![feature(quote)]
1412
#![feature(managed_boxes)]
1513

@@ -18,11 +16,11 @@ extern crate syntax;
1816
use syntax::ext::base::ExtCtxt;
1917

2018
fn syntax_extension(cx: &ExtCtxt) {
21-
let e_toks : Vec<syntax::ast::token_tree> = quote_tokens!(cx, 1 + 2);
22-
let p_toks : Vec<syntax::ast::token_tree> = quote_tokens!(cx, (x, 1 .. 4, *));
19+
let e_toks : Vec<syntax::ast::TokenTree> = quote_tokens!(cx, 1 + 2);
20+
let p_toks : Vec<syntax::ast::TokenTree> = quote_tokens!(cx, (x, 1 .. 4, *));
2321

2422
let a: @syntax::ast::Expr = quote_expr!(cx, 1 + 2);
25-
let _b: Option<@syntax::ast::item> = quote_item!(cx, static foo : int = $e_toks; );
23+
let _b: Option<@syntax::ast::Item> = quote_item!(cx, static foo : int = $e_toks; );
2624
let _c: @syntax::ast::Pat = quote_pat!(cx, (x, 1 .. 4, *) );
2725
let _d: @syntax::ast::Stmt = quote_stmt!(cx, let x = $a; );
2826
let _e: @syntax::ast::Expr = quote_expr!(cx, match foo { $p_toks => 10 } );

0 commit comments

Comments
 (0)