Skip to content

Commit

Permalink
Rollup merge of #23018 - sanxiyn:quote-question, r=huonw
Browse files Browse the repository at this point in the history
 Fix #22957.
  • Loading branch information
Manishearth committed Mar 5, 2015
2 parents 71ef073 + 951118b commit 4de4234
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/libsyntax/ext/quote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -676,9 +676,10 @@ fn expr_mk_token(cx: &ExtCtxt, sp: Span, tok: &token::Token) -> P<ast::Expr> {
token::FatArrow => "FatArrow",
token::Pound => "Pound",
token::Dollar => "Dollar",
token::Question => "Question",
token::Underscore => "Underscore",
token::Eof => "Eof",
_ => panic!(),
_ => panic!("unhandled token in quote!"),
};
mk_token_path(cx, sp, name)
}
Expand Down
4 changes: 3 additions & 1 deletion src/test/run-pass-fulldeps/quote-tokens.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand Down Expand Up @@ -43,6 +43,8 @@ fn syntax_extension(cx: &ExtCtxt) {

let _m: Vec<syntax::ast::TokenTree> = quote_matcher!(cx, $($foo:tt,)* bar);
let _n: syntax::ast::Attribute = quote_attr!(cx, #![cfg(foo, bar = "baz")]);

let _o: Option<P<syntax::ast::Item>> = quote_item!(cx, fn foo<T: ?Sized>() {});
}

fn main() {
Expand Down

0 comments on commit 4de4234

Please sign in to comment.