Skip to content

Commit

Permalink
Fix quoting of ?Sized
Browse files Browse the repository at this point in the history
  • Loading branch information
sanxiyn committed Mar 4, 2015
1 parent fed1249 commit 8a60b91
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libsyntax/ext/quote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -635,9 +635,10 @@ fn 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
2 changes: 2 additions & 0 deletions src/test/run-pass-fulldeps/quote-tokens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ fn syntax_extension(cx: &ExtCtxt) {
let _k: P<syntax::ast::Method> = quote_method!(cx, #[doc = "hello"] fn foo(&self) {});

let _l: P<syntax::ast::Ty> = quote_ty!(cx, &int);

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

fn main() {
Expand Down

0 comments on commit 8a60b91

Please sign in to comment.