]> git.lizzy.rs Git - rust.git/commitdiff
Fix quoting of ?Sized
authorSeo Sanghyeon <sanxiyn@gmail.com>
Wed, 4 Mar 2015 05:58:35 +0000 (14:58 +0900)
committerManish Goregaokar <manishsmail@gmail.com>
Thu, 5 Mar 2015 07:08:30 +0000 (12:38 +0530)
src/libsyntax/ext/quote.rs
src/test/run-pass-fulldeps/quote-tokens.rs

index 2599a53e313277cbc430699b5fc436a72121e690..737648cd90c37bc56cf3a4715157bd8bea08ed78 100644 (file)
@@ -676,9 +676,10 @@ macro_rules! mk_lit {
         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)
 }
index 4e6f9b46402956e51100735eda180f76e0b6d4dc..a9b77419b9a37ad7a59ec5c54608b06ab4d5e87a 100644 (file)
@@ -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.
 //
@@ -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() {