From: Huon Wilson Date: Thu, 12 Jun 2014 23:36:26 +0000 (+1000) Subject: syntax: fix quote_pat! & unignore a quotation test. X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=9d5ec04d184a5d28e75d74b725ebb7cc21b547af;p=rust.git syntax: fix quote_pat! & unignore a quotation test. --- diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs index 185924f704c..bc5442a94fb 100644 --- a/src/libsyntax/ext/quote.rs +++ b/src/libsyntax/ext/quote.rs @@ -368,9 +368,7 @@ pub fn expand_quote_pat(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) -> Box { - let e_refutable = cx.expr_lit(sp, ast::LitBool(true)); - let expanded = expand_parse_call(cx, sp, "parse_pat", - vec!(e_refutable), tts); + let expanded = expand_parse_call(cx, sp, "parse_pat", vec!(), tts); base::MacExpr::new(expanded) } diff --git a/src/test/run-pass-fulldeps/quote-tokens.rs b/src/test/run-pass-fulldeps/quote-tokens.rs index 7c25246807d..c41ec0dbd65 100644 --- a/src/test/run-pass-fulldeps/quote-tokens.rs +++ b/src/test/run-pass-fulldeps/quote-tokens.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// ignore-test - #![feature(quote)] #![feature(managed_boxes)] @@ -18,11 +16,11 @@ use syntax::ext::base::ExtCtxt; fn syntax_extension(cx: &ExtCtxt) { - let e_toks : Vec = quote_tokens!(cx, 1 + 2); - let p_toks : Vec = quote_tokens!(cx, (x, 1 .. 4, *)); + let e_toks : Vec = quote_tokens!(cx, 1 + 2); + let p_toks : Vec = quote_tokens!(cx, (x, 1 .. 4, *)); let a: @syntax::ast::Expr = quote_expr!(cx, 1 + 2); - let _b: Option<@syntax::ast::item> = quote_item!(cx, static foo : int = $e_toks; ); + let _b: Option<@syntax::ast::Item> = quote_item!(cx, static foo : int = $e_toks; ); let _c: @syntax::ast::Pat = quote_pat!(cx, (x, 1 .. 4, *) ); let _d: @syntax::ast::Stmt = quote_stmt!(cx, let x = $a; ); let _e: @syntax::ast::Expr = quote_expr!(cx, match foo { $p_toks => 10 } );