diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs index 696d62838ba79..0eab9a90b956b 100644 --- a/src/libsyntax/ext/quote.rs +++ b/src/libsyntax/ext/quote.rs @@ -67,6 +67,15 @@ pub mod rt { } } + impl ToTokens for Option { + fn to_tokens(&self, cx: &ExtCtxt) -> Vec { + match self { + &Some(ref t) => t.to_tokens(cx), + &None => Vec::new(), + } + } + } + /* Should be (when bugs in default methods are fixed): trait ToSource : ToTokens {