Auto merge of #29825 - KyleMayes:move-parse-panic, r=sanxiyn

Since these functions are only used by the AST quoting syntax extensions, they should be there instead of in the parser.
This commit is contained in:
bors 2015-11-14 08:03:14 +00:00
commit 929ca3cb51
3 changed files with 53 additions and 51 deletions

View file

@ -54,7 +54,7 @@ fn expand_identity(cx: &mut ExtCtxt, _span: Span, tts: &[TokenTree])
// Parse an expression and emit it unchanged.
let mut parser = parse::new_parser_from_tts(cx.parse_sess(),
cx.cfg(), tts.to_vec());
let expr = parser.parse_expr_panic();
let expr = parser.parse_expr().unwrap();
MacEager::expr(quote_expr!(&mut *cx, $expr))
}