From c77a0cf5881e8e894d6fc15403cca002b9781d15 Mon Sep 17 00:00:00 2001 From: Esteban Küber Date: Wed, 10 Oct 2018 16:54:17 -0700 Subject: Accept `Option>` in macro argument Given the following code, compile successfuly: ``` macro_rules! test { ( fn fun() -> Option>; ) => { fn fun(x: $t) -> Option> { Some(Box::new(x)) } } } test! { fn fun() -> Option>; } ``` --- src/libsyntax/ext/tt/macro_rules.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/libsyntax/ext') diff --git a/src/libsyntax/ext/tt/macro_rules.rs b/src/libsyntax/ext/tt/macro_rules.rs index 214bc9cffc4..07d9bdb03ad 100644 --- a/src/libsyntax/ext/tt/macro_rules.rs +++ b/src/libsyntax/ext/tt/macro_rules.rs @@ -902,7 +902,8 @@ fn is_in_follow(tok: "ed::TokenTree, frag: &str) -> Result match *tok { TokenTree::Token(_, ref tok) => match *tok { OpenDelim(token::DelimToken::Brace) | OpenDelim(token::DelimToken::Bracket) | - Comma | FatArrow | Colon | Eq | Gt | Semi | BinOp(token::Or) => Ok(true), + Comma | FatArrow | Colon | Eq | Gt | BinOp(token::Shr) | Semi | + BinOp(token::Or) => Ok(true), Ident(i, false) if i.name == "as" || i.name == "where" => Ok(true), _ => Ok(false) }, -- cgit 1.4.1-3-g733a5