Skip to content

Commit 8a60b91

Browse files
committed
Fix quoting of ?Sized
1 parent fed1249 commit 8a60b91

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/libsyntax/ext/quote.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -635,9 +635,10 @@ fn mk_token(cx: &ExtCtxt, sp: Span, tok: &token::Token) -> P<ast::Expr> {
635635
token::FatArrow => "FatArrow",
636636
token::Pound => "Pound",
637637
token::Dollar => "Dollar",
638+
token::Question => "Question",
638639
token::Underscore => "Underscore",
639640
token::Eof => "Eof",
640-
_ => panic!(),
641+
_ => panic!("unhandled token in quote!"),
641642
};
642643
mk_token_path(cx, sp, name)
643644
}

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

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ fn syntax_extension(cx: &ExtCtxt) {
4040
let _k: P<syntax::ast::Method> = quote_method!(cx, #[doc = "hello"] fn foo(&self) {});
4141

4242
let _l: P<syntax::ast::Ty> = quote_ty!(cx, &int);
43+
44+
let _m: Option<P<syntax::ast::Item>> = quote_item!(cx, fn foo<T: ?Sized>() {});
4345
}
4446

4547
fn main() {

0 commit comments

Comments
 (0)